Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Uno Hello Linux

Uno Hello Linux

The goal of this session to introduce Linux fans to a one-stop solution for building custom Linux tools with. NET. Ship to the Web as well from the same codebase — with some help from VS Code.

Cyromaven Tools

February 24, 2023
Tweet

More Decks by Cyromaven Tools

Other Decks in Technology

Transcript

  1. February 24, 2023
    Aba Microsoft User Hangout
    Uno Hello
    Linux
    Running Uno
    Platform App
    on Linux for
    the first time.

    View Slide

  2. Quite simply Uno Platform is
    the only choice if you want
    cross platform, high quality
    applications written in C#.
    James Hancock
    Aba Microsoft User Hangout February 24, 2023

    View Slide

  3. Intro
    Presenter
    @cyromaven
    Name: David Onoh
    Job: Software Developer | Educator
    Tag: Supporting the .NET ecosystem
    through Meetups and shared resources. Time: 30 minutes

    View Slide

  4. Today's
    Agenda
    1 Session Introduction
    2 Prerequisites
    3 Environment and App Canvas
    4 Modify Template and Run
    Aba Microsoft User Hangout February 24, 2023

    View Slide

  5. Introduction
    Build Pixel Perfect Cross-Platform Apps
    From Linux with .NET and VS Code
    The goal of this session to introduce Linux fans to a one-
    stop solution for building custom Linux tools with. NET.
    Ship to the Web as well from the same codebase — with
    some help from VS Code.
    February 24, 2023
    Aba Microsoft User Hangout

    View Slide

  6. February 24, 2023
    Aba Microsoft User Hangout
    Let's Begin!
    Are you ready?

    View Slide

  7. Prerequisites START RUN END
    Visual Studio Code
    The Uno Platform Visual Studio Code Extension
    .NET SDK
    .NET 7.0 SDK (version 7.0 (SDK 7.0.102) or later)
    Optionally, you might need the Gtk+3 runtime, as well
    Use dotnet --version from the terminal to get the version installed.

    View Slide

  8. Environment
    1* Open a Terminal
    START RUN END
    2* b* To update the tool, if you already have a legacy one:
    2* a* Install the tool by running the following command from the command prompt:
    dotnet tool install -g uno.check
    dotnet tool update -g uno.check

    View Slide

  9. Environment START RUN END
    3* Run the tool from the command prompt with the following command:
    4* Follow the instructions indicated by the tool
    2* If the above command fails, use the following:
    uno-check
    ~/.dotnet/tools/uno-check

    View Slide

  10. App Canvas
    1* In the terminal, type the following to create a new project:
    START RUN END
    This will create the Canvas that includes support for only the
    WebAssembly and Skia+GTK platforms
    dotnet new unoapp -o UnoHelloLinux -mobile=false --skia-
    wpf=false --skia-linux-fb=false --vscode

    View Slide

  11. App Canvas START RUN END
    2* Open Visual Studio Code to see the generated codebase or run
    the following code from the Terminal:
    4* Once the project has been loaded, in the status bar at the bottom
    left of VS Code, UnoHelloLinux.sln is selected by default. Select
    UnoHelloLinux.Skia.Gtk.csproj instead.
    code ./UnoHelloLinux
    3* Visual Studio Code will ask to restore the NuGet packages.

    View Slide

  12. Modify Template START RUN END



    Margin="20" FontSize="30" />



    Replace the Grid's content with the following
    lines of code. This will add a StackPanel, a
    TextBlock, a Slider, and a Binder to give a
    dynamic result on the first try. Your new Grid
    layout should look like this:
    In your UnoHelloLinux Class Library
    project, open up MainPage.xaml

    View Slide

  13. Run START RUN END
    On Linux
    In the debugger section of the Code activity bar,
    select Skia.GTK (Debug)
    Press F5 to start the debugging session
    Place a breakpoint inside the OnClick method
    Click the button in the app, and the breakpoint will
    hit
    1.
    2.
    3.
    4.
    On WebAssembly
    In the debugger section of the Code activity bar,
    select Debug (Chrome, WebAssembly)
    Press F5 to start the debugging session
    Place a breakpoint inside the OnClick method
    Click the button in the app, and the breakpoint will
    hit
    1.
    2.
    3.
    4.

    View Slide

  14. Preview
    You can finally see a screenshot of the code run
    here. For more information you can follow up on
    next steps at:
    https://platform.uno/docs/articles/getting-started-
    tutorial-2.html
    February 24, 2023
    Aba Microsoft User Hangout

    View Slide

  15. February 24, 2023
    Aba Microsoft User Hangout
    With the Uno Platform, I can
    expose powerful, flexible user
    experiences on every single
    platform my users need.
    Billy Hollis

    View Slide

  16. February 24, 2023
    Aba Microsoft User Hangout
    Thank
    you! Have a great
    day ahead.

    View Slide