<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Carlos Fabara</title>
    <description>The latest articles on DEV Community by Carlos Fabara (@carlos487).</description>
    <link>https://dev.to/carlos487</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F69901%2F5823a8f1-85c8-4e2c-b129-9f28aac0ed49.jpeg</url>
      <title>DEV Community: Carlos Fabara</title>
      <link>https://dev.to/carlos487</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/carlos487"/>
    <language>en</language>
    <item>
      <title>Avalonia UI on Ubuntu: Margin and Padding</title>
      <dc:creator>Carlos Fabara</dc:creator>
      <pubDate>Thu, 21 Jan 2021 03:22:39 +0000</pubDate>
      <link>https://dev.to/carlos487/avalonia-ui-on-ubuntu-margin-and-padding-15hp</link>
      <guid>https://dev.to/carlos487/avalonia-ui-on-ubuntu-margin-and-padding-15hp</guid>
      <description>&lt;p&gt;This chapter of the Avalonia series will focus on adding some space to the UI. But before we can proceed, we have to make to some small changes. &lt;/p&gt;

&lt;p&gt;The release of .Net 5 was a big step forward for the framework, so we are going to update the project to work with it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Updating the project
&lt;/h2&gt;

&lt;p&gt;To update the Avalonia project to .Net 5 is necessary to edit the file &lt;code&gt;MyApp.csproj&lt;/code&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;

&lt;span class="nt"&gt;&amp;lt;TargetFramework&amp;gt;&lt;/span&gt;net5.0&lt;span class="nt"&gt;&amp;lt;/TargetFramework&amp;gt;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Then you can manually update the version for the Avalonia Nuget packages accordingly to the latest available, which is &lt;code&gt;0.9.12&lt;/code&gt; at the moment of writing this post.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;

&lt;span class="nt"&gt;&amp;lt;PackageReference&lt;/span&gt; &lt;span class="na"&gt;Include=&lt;/span&gt;&lt;span class="s"&gt;"Avalonia"&lt;/span&gt; &lt;span class="na"&gt;Version=&lt;/span&gt;&lt;span class="s"&gt;"0.9.12"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;PackageReference&lt;/span&gt; &lt;span class="na"&gt;Include=&lt;/span&gt;&lt;span class="s"&gt;"Avalonia.Desktop"&lt;/span&gt; &lt;span class="na"&gt;Version=&lt;/span&gt;&lt;span class="s"&gt;"0.9.12"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Alternatively, you can automatically get the latest version by using the &lt;strong&gt;dotnet CLI&lt;/strong&gt;. By running the following commands:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

dotnet add package Avalonia
dotnet add package Avalonia.Desktop


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;No matter which way was used to update the packages, in the end you need to run &lt;code&gt;dotnet restore&lt;/code&gt; to get the new packages. &lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

dotnet restore


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;After running &lt;code&gt;dotnet run&lt;/code&gt;, the application will be updated and running as usual.&lt;/p&gt;

&lt;h2&gt;
  
  
  Improving the current UI
&lt;/h2&gt;

&lt;p&gt;The current application works, but it has some minor issues. The default window size is quite big in comparison to the other elements, there is a lot of unused space and the controls are too close to each other. So we are going to fix it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F85uhruucloq0upspkvnq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F85uhruucloq0upspkvnq.png" alt="Default Window size"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Fixing the windows size
&lt;/h3&gt;

&lt;p&gt;If you open &lt;code&gt;MainWindow.xaml&lt;/code&gt; the first instinctive change would modify the following attributes, but sadly those are only used by the Visual Studio designer that is why they have a &lt;code&gt;d:&lt;/code&gt; prefix&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

d:DesignWidth="800" d:DesignHeight="450"


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The correct way to change the window size is by adding the attributes &lt;code&gt;Width&lt;/code&gt; and &lt;code&gt;Height&lt;/code&gt; with a numeric value that represent its "pixel" size.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;

&lt;span class="nt"&gt;&amp;lt;Window&lt;/span&gt; &lt;span class="err"&gt;...&lt;/span&gt;
        &lt;span class="err"&gt;...&lt;/span&gt;
        &lt;span class="na"&gt;Width=&lt;/span&gt;&lt;span class="s"&gt;"300"&lt;/span&gt; &lt;span class="na"&gt;Height=&lt;/span&gt;&lt;span class="s"&gt;"200"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F533drw49hb8xkfbt589c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F533drw49hb8xkfbt589c.png" alt="Updated windows size"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see the new window size suits its purpose better. Next we are going to add some space between the controls.&lt;/p&gt;

&lt;h3&gt;
  
  
  Adding some space
&lt;/h3&gt;

&lt;p&gt;If your have used CSS you might be familiar with the concepts of Margin and Padding, which are basically space you can add outside the boundaries of the control (margins) or inside its boundaries (padding)&lt;/p&gt;

&lt;p&gt;The Avalonia team has created a great explanation of them in the following docs entry &lt;a href="https://avaloniaui.net/docs/layout/alignment-margins-padding" rel="noopener noreferrer"&gt;Avalonia Docs: Alignment, Margins and Padding&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This properties &lt;code&gt;Margin&lt;/code&gt; or &lt;code&gt;Padding&lt;/code&gt; need to be added to a Window, Container or Control. The syntax from the following example is also applicable to Margin too.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;

&lt;span class="nt"&gt;&amp;lt;Window&lt;/span&gt; &lt;span class="na"&gt;Padding=&lt;/span&gt;&lt;span class="s"&gt;"10"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
All sides have the same padding

&lt;span class="nt"&gt;&amp;lt;Window&lt;/span&gt; &lt;span class="na"&gt;Padding=&lt;/span&gt;&lt;span class="s"&gt;"10, 10"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
Represents &lt;span class="nt"&gt;&amp;lt;Window&lt;/span&gt; &lt;span class="na"&gt;Padding=&lt;/span&gt;&lt;span class="s"&gt;"left-rigth, top-bottom"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;Window&lt;/span&gt; &lt;span class="na"&gt;Padding=&lt;/span&gt;&lt;span class="s"&gt;"10, 10, 10, 10"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
Represents &lt;span class="nt"&gt;&amp;lt;Window&lt;/span&gt; &lt;span class="na"&gt;Padding=&lt;/span&gt;&lt;span class="s"&gt;"left, top, right, bottom"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;Be aware that not all the controls can have a Padding/Margin property. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For the example we are going to add a &lt;code&gt;Padding: 10&lt;/code&gt; to the Window and a &lt;code&gt;Margin: 0, 0, 0, 10&lt;/code&gt; to the first label, textbox, and button.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;

&lt;span class="nt"&gt;&amp;lt;Window&lt;/span&gt; &lt;span class="na"&gt;xmlns=&lt;/span&gt;&lt;span class="s"&gt;"https://github.com/avaloniaui"&lt;/span&gt;
        &lt;span class="na"&gt;xmlns:x=&lt;/span&gt;&lt;span class="s"&gt;"http://schemas.microsoft.com/winfx/2006/xaml"&lt;/span&gt;
        &lt;span class="na"&gt;xmlns:d=&lt;/span&gt;&lt;span class="s"&gt;"http://schemas.microsoft.com/expression/blend/2008"&lt;/span&gt;
        &lt;span class="na"&gt;xmlns:mc=&lt;/span&gt;&lt;span class="s"&gt;"http://schemas.openxmlformats.org/markup-compatibility/2006"&lt;/span&gt;
        &lt;span class="na"&gt;mc:Ignorable=&lt;/span&gt;&lt;span class="s"&gt;"d"&lt;/span&gt; &lt;span class="na"&gt;d:DesignWidth=&lt;/span&gt;&lt;span class="s"&gt;"800"&lt;/span&gt; &lt;span class="na"&gt;d:DesignHeight=&lt;/span&gt;&lt;span class="s"&gt;"450"&lt;/span&gt;
        &lt;span class="na"&gt;x:Class=&lt;/span&gt;&lt;span class="s"&gt;"MyApp.MainWindow"&lt;/span&gt;
        &lt;span class="na"&gt;Title=&lt;/span&gt;&lt;span class="s"&gt;"MyApp"&lt;/span&gt;
        &lt;span class="na"&gt;Width=&lt;/span&gt;&lt;span class="s"&gt;"300"&lt;/span&gt; &lt;span class="na"&gt;Height=&lt;/span&gt;&lt;span class="s"&gt;"200"&lt;/span&gt; &lt;span class="na"&gt;Padding=&lt;/span&gt;&lt;span class="s"&gt;"10"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;StackPanel&lt;/span&gt; &lt;span class="na"&gt;Orientation=&lt;/span&gt;&lt;span class="s"&gt;"Vertical"&lt;/span&gt; &lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;TextBlock&lt;/span&gt; &lt;span class="na"&gt;Name=&lt;/span&gt;&lt;span class="s"&gt;"NameLabel"&lt;/span&gt; &lt;span class="na"&gt;Margin=&lt;/span&gt;&lt;span class="s"&gt;"0,0,0,10"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;What is your name?&lt;span class="nt"&gt;&amp;lt;/TextBlock&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;TextBox&lt;/span&gt; &lt;span class="na"&gt;Name=&lt;/span&gt;&lt;span class="s"&gt;"NameTextBox"&lt;/span&gt; &lt;span class="na"&gt;Margin=&lt;/span&gt;&lt;span class="s"&gt;"0,0,0,10"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/TextBox&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;Button&lt;/span&gt; &lt;span class="na"&gt;Name=&lt;/span&gt;&lt;span class="s"&gt;"GreetButton"&lt;/span&gt; &lt;span class="na"&gt;Margin=&lt;/span&gt;&lt;span class="s"&gt;"0,0,0,10"&lt;/span&gt; &lt;span class="na"&gt;Click=&lt;/span&gt;&lt;span class="s"&gt;"GreetButton_Click"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Say Hello!&lt;span class="nt"&gt;&amp;lt;/Button&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;TextBlock&lt;/span&gt; &lt;span class="na"&gt;Name=&lt;/span&gt;&lt;span class="s"&gt;"MessageLabel"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/TextBlock&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/StackPanel&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/Window&amp;gt;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;If you run the application, you will have the following result.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fln0s0khyzccduq17dtgm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fln0s0khyzccduq17dtgm.png" alt="Some space added"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see now there is some spacing that can be improve legibility and usability.&lt;/p&gt;

&lt;p&gt;The code for this chapter will be located in the repo &lt;a href="https://github.com/Carlos487/avalonia-ui-ubuntu-tutorial" rel="noopener noreferrer"&gt;Avalonia UI in Ubuntu Tutorial&lt;/a&gt; with the tag &lt;code&gt;03-end&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I hope you find this post useful, in the following chapter we are going to explore how to style controls.&lt;/p&gt;

</description>
      <category>avalonia</category>
      <category>dotnet</category>
      <category>ui</category>
      <category>ubuntu</category>
    </item>
    <item>
      <title>Avalonia UI on Ubuntu: Interacting with Controls</title>
      <dc:creator>Carlos Fabara</dc:creator>
      <pubDate>Fri, 24 Jul 2020 17:16:58 +0000</pubDate>
      <link>https://dev.to/carlos487/avalonia-ui-in-ubuntu-interacting-with-controls-14n5</link>
      <guid>https://dev.to/carlos487/avalonia-ui-in-ubuntu-interacting-with-controls-14n5</guid>
      <description>&lt;p&gt;Welcome to the second post of the series about Avalonia UI. In this post we are going to see how to interact with Controls using the default template created in the previous post.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You can get the starting code in the &lt;a href="https://github.com/Carlos487/avalonia-ui-ubuntu-tutorial" rel="noopener noreferrer"&gt;Avalonia UI in Ubuntu Tutorial&lt;/a&gt; Git repository with the tag &lt;code&gt;02-start&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You can open the &lt;code&gt;MyApp&lt;/code&gt; folder by using &lt;strong&gt;Visual Studio Code&lt;/strong&gt;. If might be prompted to install any missing extension like the &lt;strong&gt;C#&lt;/strong&gt; one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding controls
&lt;/h2&gt;

&lt;p&gt;First, we need to open the &lt;code&gt;MainWindow.xaml&lt;/code&gt; file. Here we need to find the "Welcome to Avalonia!" text and change it to a StackPanel layout manager with a vertical orientation.&lt;/p&gt;

&lt;p&gt;This will make the controls to stack one after the other so we don't worry about their positioning by now.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;

&lt;span class="nt"&gt;&amp;lt;StackPanel&lt;/span&gt; &lt;span class="na"&gt;Orientation=&lt;/span&gt;&lt;span class="s"&gt;"Vertical"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/StackPanel&amp;gt;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Next, we need to add inside the StackPanel a TextBlock with the name &lt;code&gt;NameLabel&lt;/code&gt;, a TextBox with the name &lt;code&gt;NameTextBox&lt;/code&gt;, a Button with the name &lt;code&gt;GreetButton&lt;/code&gt; and another TextBlock with the name &lt;code&gt;MessageLabel&lt;/code&gt;.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;

&lt;span class="nt"&gt;&amp;lt;TextBlock&lt;/span&gt; &lt;span class="na"&gt;Name=&lt;/span&gt;&lt;span class="s"&gt;"NameLabel"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;What is your name?&lt;span class="nt"&gt;&amp;lt;/TextBlock&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;TextBox&lt;/span&gt; &lt;span class="na"&gt;Name=&lt;/span&gt;&lt;span class="s"&gt;"NameTextBox"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/TextBox&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;Button&lt;/span&gt; &lt;span class="na"&gt;Name=&lt;/span&gt;&lt;span class="s"&gt;"GreetButton"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Say Hello!&lt;span class="nt"&gt;&amp;lt;/Button&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;TextBlock&lt;/span&gt; &lt;span class="na"&gt;Name=&lt;/span&gt;&lt;span class="s"&gt;"MessageLabel"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/TextBlock&amp;gt;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;If you run the project using &lt;code&gt;dotnet run&lt;/code&gt; you should see the following:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fcqw0rqi05xvm2nxpcdsw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fcqw0rqi05xvm2nxpcdsw.png" alt="Controls added"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The window at the moment is big, but can be resized. Changing the Window properties will be explored in upcoming tutorials.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Managing the click event
&lt;/h2&gt;

&lt;p&gt;To manage the click we need to first add an Event Handler with the following signature inside the class from the &lt;code&gt;MainWindow.xaml.cs&lt;/code&gt;.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;

&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;GreetButton_Click&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;object&lt;/span&gt; &lt;span class="n"&gt;sender&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;RoutedEventArgs&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;//Add logic here&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;This will require to add the &lt;code&gt;using Avalonia.Interactivity;&lt;/code&gt; for this file.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Then modify the &lt;code&gt;Button&lt;/code&gt; tag in the XAML by adding the &lt;code&gt;Click&lt;/code&gt; property with the method name as a value&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;

&lt;span class="nt"&gt;&amp;lt;Button&lt;/span&gt; &lt;span class="na"&gt;Name=&lt;/span&gt;&lt;span class="s"&gt;"GreetButton"&lt;/span&gt; &lt;span class="na"&gt;Click=&lt;/span&gt;&lt;span class="s"&gt;"GreetButton_Click"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Say Hello!&lt;span class="nt"&gt;&amp;lt;/Button&amp;gt;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  Accessing controls
&lt;/h2&gt;

&lt;p&gt;Given that our project is using the base Avalonia template we need to access the controls manually from the code behind. Inside the &lt;code&gt;GreetButton_Click&lt;/code&gt; method we need to add the following:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;

&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;GreetButton_Click&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;object&lt;/span&gt; &lt;span class="n"&gt;sender&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;RoutedEventArgs&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;//Getting Controls references&lt;/span&gt;
    &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;nameControl&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;FindControl&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;TextBox&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;(&lt;/span&gt;&lt;span class="s"&gt;"NameTextBox"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;messageControl&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;FindControl&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;TextBlock&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;(&lt;/span&gt;&lt;span class="s"&gt;"MessageLabel"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;//Setting the value&lt;/span&gt;
    &lt;span class="n"&gt;messageControl&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Text&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;$"Hello &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;nameControl&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt; !!!"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The &lt;code&gt;FindControl&amp;lt;T&amp;gt;&lt;/code&gt; method allows to retrieve the reference of the Controls from the window.&lt;/p&gt;

&lt;p&gt;For this example we are using the &lt;code&gt;Text&lt;/code&gt; property to read the value from the TextBox and set it into the Message Label.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;

&lt;span class="n"&gt;messageControl&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Text&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;$"Hello &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;nameControl&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt; !!!"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Next, run the program, fill your name and click the button. The label with a greeting message with appear.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fxmzf7t4ghvw5s4nhx1n4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fxmzf7t4ghvw5s4nhx1n4.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Remember that all the code for this tutorial in the &lt;a href="https://github.com/Carlos487/avalonia-ui-ubuntu-tutorial" rel="noopener noreferrer"&gt;Avalonia UI in Ubuntu Tutorial&lt;/a&gt; Git repository with the tag &lt;code&gt;02-end&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>avalonia</category>
      <category>dotnet</category>
      <category>ui</category>
      <category>ubuntu</category>
    </item>
    <item>
      <title>Avalonia UI on Ubuntu: Getting Started</title>
      <dc:creator>Carlos Fabara</dc:creator>
      <pubDate>Sat, 27 Jun 2020 16:39:41 +0000</pubDate>
      <link>https://dev.to/carlos487/avalonia-ui-in-ubuntu-getting-started-2fak</link>
      <guid>https://dev.to/carlos487/avalonia-ui-in-ubuntu-getting-started-2fak</guid>
      <description>&lt;p&gt;&lt;a href="https://avaloniaui.net/" rel="noopener noreferrer"&gt;Avalonia UI&lt;/a&gt; is a cross-platform UI framework available for Dotnet Core. It is a project part of the .Net Foundation. Its main appeal is to provide the ability to create desktop applications for Windows, Linux and MacOS with a single code base.&lt;/p&gt;

&lt;p&gt;In this tutorial we will see how to install the Avalonia templates and create a blank application.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing templates
&lt;/h2&gt;

&lt;p&gt;The first thing we need to do is installing the Avalonia Templates so the &lt;strong&gt;dotnet new&lt;/strong&gt; command could use them when creating new applications.&lt;/p&gt;

&lt;p&gt;You need to go to the following Github Repository &lt;a href="https://github.com/AvaloniaUI/avalonia-dotnet-templates" rel="noopener noreferrer"&gt;Avalonia Templates for dotnet new&lt;/a&gt; and download the zip version. Alternatively, you could clone it to your machine if you have git installed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fri30y569bk9ta6sdaf92.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fri30y569bk9ta6sdaf92.png" alt="Avalonia templates Github Repo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After you have unzipped the file in the location you prefer. It is needed to run the following command. Keep in mind the path you need to use is the route to the unzipped templates&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

dotnet new --install [path-to-templates-folder]


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;Tip: An easy way to add the folder path to the command line is to drag and drop the folder from the File Explorer&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7sa75gtvkad9nl7c8u61.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7sa75gtvkad9nl7c8u61.png" alt="Drag and drop folder to the terminal"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating an Avalonia application
&lt;/h2&gt;

&lt;p&gt;The command executed on the previous step adds a few more templates to the &lt;code&gt;dotnet new&lt;/code&gt; command.&lt;/p&gt;

&lt;p&gt;There are two project templates added are the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;avalonia.app:&lt;/strong&gt; To create a barebones Avalonia application&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;avalonia.mvvm:&lt;/strong&gt; To create an application that uses the Model-View-ViewModel pattern with ReactiveUI&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To create a new application you need to run the following command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

dotnet new avalonia.app -o MyApp


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Where &lt;code&gt;MyApp&lt;/code&gt; is the name of the application we are creating.&lt;/p&gt;

&lt;h2&gt;
  
  
  Running the application
&lt;/h2&gt;

&lt;p&gt;To run the application you need to get into the MyApp folder&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

cd MyApp


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;and then run the app with the dotnet CLI&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

dotnet run


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The result will be the following as a blank app shows on screen.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fhd44iiawhwhsro2wyt2g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fhd44iiawhwhsro2wyt2g.png" alt="Blank Avalonia App"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I hope you find this useful. In following entries we will continue exploring the Avalonia UI framework.&lt;/p&gt;

</description>
      <category>avalonia</category>
      <category>ubuntu</category>
      <category>dotnet</category>
      <category>ui</category>
    </item>
    <item>
      <title>Installing DotNet Core in Ubuntu 20.04</title>
      <dc:creator>Carlos Fabara</dc:creator>
      <pubDate>Fri, 24 Apr 2020 15:55:20 +0000</pubDate>
      <link>https://dev.to/carlos487/installing-dotnet-core-in-ubuntu-20-04-6jh</link>
      <guid>https://dev.to/carlos487/installing-dotnet-core-in-ubuntu-20-04-6jh</guid>
      <description>&lt;p&gt;&lt;strong&gt;UPDATE: Microsoft added the official docs to &lt;a href="https://docs.microsoft.com/en-us/dotnet/core/install/linux-package-manager-ubuntu-2004" rel="noopener noreferrer"&gt;Install .NET Core on Ubuntu 20.04 package manager&lt;/a&gt;.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;UPDATE 2: Added link to scripted installation alternative &lt;a href="https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu#scripted-install" rel="noopener noreferrer"&gt;Scripted Install&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The newest Ubuntu LTS release is available now. Sadly, at the time of this writing (April 24th), there is no official installation method for Ubuntu 20.04 listed on the .Net website.&lt;/p&gt;

&lt;h1&gt;
  
  
  Manual Installation
&lt;/h1&gt;

&lt;p&gt;For this tutorial we are going to manually install DotNet Core 3.1.201 SDK using the binaries provided in the official page.&lt;/p&gt;

&lt;h2&gt;
  
  
  Download the binaries
&lt;/h2&gt;

&lt;p&gt;Head to &lt;a href="https://dotnet.microsoft.com/download/dotnet-core/3.1" rel="noopener noreferrer"&gt;.Net Core Downloads&lt;/a&gt; and look for the x64 Binaries in the Linux.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F48a9f1i1ezf5by85fuxe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F48a9f1i1ezf5by85fuxe.png" alt="Linux Binaries Download page"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Alternatively you can use &lt;a href="https://dotnet.microsoft.com/download/dotnet-core/thank-you/sdk-3.1.201-linux-x64-binaries" rel="noopener noreferrer"&gt;this link&lt;/a&gt; to get the specific version used in this tutorial.&lt;/p&gt;

&lt;h1&gt;
  
  
  Extract and link
&lt;/h1&gt;

&lt;p&gt;After the download finishes, open a Terminal (you can use Super+Alt+T as a shortcut).&lt;/p&gt;

&lt;p&gt;Navigate to the folder where it was downloaded and run the following command&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; &lt;span class="nv"&gt;$HOME&lt;/span&gt;/dotnet &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;tar &lt;/span&gt;zxf dotnet-sdk-3.1.201-linux-x64.tar.gz &lt;span class="nt"&gt;-C&lt;/span&gt; &lt;span class="nv"&gt;$HOME&lt;/span&gt;/dotnet


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This command will create a dotnet folder on the user's home directory and extract there the contents of the file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Please be aware that the file name &lt;code&gt;dotnet-sdk-3.1.201-linux-x64.tar.gz&lt;/code&gt; matches the one you downloaded, otherwise you might need to modify the previous command accordingly to your download.&lt;/p&gt;

&lt;h2&gt;
  
  
  Export variables
&lt;/h2&gt;

&lt;p&gt;Run the following commands to temporarily add the dotnet binaries in your terminal session.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;DOTNET_ROOT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;/dotnet


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;and&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;PATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$PATH&lt;/span&gt;:&lt;span class="nv"&gt;$HOME&lt;/span&gt;/dotnet


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; This will work only for the current session, at the end of the tutorial you will find instructions to add it permanently.&lt;/p&gt;

&lt;h2&gt;
  
  
  Test the installation
&lt;/h2&gt;

&lt;p&gt;Run &lt;code&gt;dotnet&lt;/code&gt; in the Terminal, and the following should show appear:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqlpohsg2r2i5k7mychg5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqlpohsg2r2i5k7mychg5.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Congratulations!&lt;/strong&gt; You have installed dotnet core.&lt;/p&gt;

&lt;h2&gt;
  
  
  Permanently add the dotnet command
&lt;/h2&gt;

&lt;p&gt;To add the dotnet commands permanently, you need to add the dotnet folder to the path of your system. To achieve this need to modify the &lt;code&gt;~/.bashrc&lt;/code&gt; file by running.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

gedit ~/.bashrc


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This will open an editor with the file contents. At the end of the file add the following two lines:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;PATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$PATH&lt;/span&gt;:&lt;span class="nv"&gt;$HOME&lt;/span&gt;/dotnet
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;DOTNET_ROOT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;/dotnet


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Save the file (Ctrl+S) and close all the open Terminal windows. Next time you open a new one &lt;code&gt;dotnet&lt;/code&gt; will be available.&lt;/p&gt;

&lt;h1&gt;
  
  
  Other installation methods
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Package Manager
&lt;/h2&gt;

&lt;p&gt;This is the official way to install dotnet core for Ubuntu based systems. The instructions for the 20.04 version can be found in &lt;a href="https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu#2004-" rel="noopener noreferrer"&gt;Package Manager Install&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Scripted Install
&lt;/h2&gt;

&lt;p&gt;It has been reported that some PopOS! users might have issues with the official and manual installation methods. In that case it might be solved by using the scripted install method whose instructions can be found in the following link &lt;a href="https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu#scripted-install" rel="noopener noreferrer"&gt;Scripted Install&lt;/a&gt;. Thanks to &lt;a href="https://dev.to/maymeow"&gt;Emma&lt;/a&gt; for the contribution.&lt;/p&gt;

</description>
      <category>dotnetcore</category>
      <category>ubuntu</category>
      <category>dotnet</category>
      <category>focal</category>
    </item>
    <item>
      <title>Installing DotNet Core in Ubuntu 18.04</title>
      <dc:creator>Carlos Fabara</dc:creator>
      <pubDate>Sat, 28 Apr 2018 22:45:05 +0000</pubDate>
      <link>https://dev.to/carlos487/installing-dotnet-core-in-ubuntu-1804-7lp</link>
      <guid>https://dev.to/carlos487/installing-dotnet-core-in-ubuntu-1804-7lp</guid>
      <description>

&lt;h1&gt;
  
  
  Update
&lt;/h1&gt;

&lt;p&gt;Since the time this article was published Microsoft has released the official way of installing DotNet Core you can find them in &lt;a href="https://www.microsoft.com/net/download/linux-package-manager/ubuntu18-04/sdk-current" rel="noopener noreferrer"&gt;DotNet Ubuntu 18.04 Downloads&lt;/a&gt; &lt;/p&gt;




&lt;p&gt;With the release of Ubuntu 18.04 the new LTS version of the popular Operating System, people might be eager to try &lt;strong&gt;dotnet&lt;/strong&gt; on the platform.&lt;/p&gt;

&lt;p&gt;Sadly, at the time of writing this post, neither the page getting stater page &lt;a href="https://www.microsoft.com/net/learn/get-started/linux" rel="noopener noreferrer"&gt;DotNet Get Stated&lt;/a&gt; nor the downloads page &lt;a href="https://www.microsoft.com/net/download/linux" rel="noopener noreferrer"&gt;DotNet Downloads&lt;/a&gt; list a compatible package with this OS.&lt;/p&gt;

&lt;p&gt;In fact, if you try to install following the instruccions for the closest release which was 17.04 &lt;a href="https://www.microsoft.com/net/download/linux" rel="noopener noreferrer"&gt;Instructions Ubuntu 17.04&lt;/a&gt; you will get an error of missing dependencies.&lt;/p&gt;

&lt;p&gt;In order to install you have to used the following steps as it is indicated in this &lt;a href="https://github.com/dotnet/core/issues/1400" rel="noopener noreferrer"&gt;GitHub issue&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Registering Microsoft keys and feeds
&lt;/h2&gt;

&lt;p&gt;It is necessary to add the keys and the feed to the system so you have to type in a terminal the following commands.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-key adv --keyserver packages.microsoft.com --recv-keys EB3E94ADBE1229CF

sudo apt-key adv --keyserver packages.microsoft.com --recv-keys 52E16F86FEE04B979B07E28DB02C46DF417A0893
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;To add the feed you need to type:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-bionic-prod bionic main" &amp;gt; /etc/apt/sources.list.d/dotnetdev.list'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;And update the packages list with&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  Installing DotNet Core
&lt;/h2&gt;

&lt;p&gt;To install dotnet you can use the stable version with:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get install dotnet-sdk-2.1.105 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Or the newest preview version with:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install dotnet-sdk-2.1.300-preview2-008533
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Remember that you can have both installed side by side, newer dotnet have the &lt;strong&gt;dotnet --list-sdks&lt;/strong&gt; and &lt;strong&gt;dotnet --list-runtimes&lt;/strong&gt;, although the newest will be used if it is not overridden with a &lt;strong&gt;global.json file&lt;/strong&gt;. You can find more info in this &lt;a href="https://www.hanselman.com/blog/ManagingDotnetCore20AndDotnetCore1xVersionedSDKsOnTheSameMachine.aspx" rel="noopener noreferrer"&gt;Scott Hanselman's post&lt;/a&gt;. Also&lt;/p&gt;

&lt;h2&gt;
  
  
  Testing the installation
&lt;/h2&gt;

&lt;p&gt;Inside a folder create a new console project with:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dotnet new console
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;To run it, you need to use:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dotnet run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;And everything works correctly qou will be able to see a Hello World message on your terminal:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hello World!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>dotnetcore</category>
      <category>ubuntu</category>
      <category>bionic</category>
      <category>beaver</category>
    </item>
  </channel>
</rss>
