whistyun / Markdown.Avalonia

render markdown with Avalonia UI
MIT License
301 stars 24 forks source link

Binding does not work #150

Closed hjrb closed 4 months ago

hjrb commented 4 months ago

I use Nothing will be displayed.

<UserControl xmlns="https://github.com/avaloniaui"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:local="clr-namespace:MyAssembly;assembly=MyAssembly"
             xmlns:md="https://github.com/whistyun/Markdown.Avalonia"
             x:Class="HowToUse.WriteMarkdownInXaml">

  <UserControl.DataContext>
    <local:UseBindingViewModel/>
  </UserControl.DataContext>

does not work

local:UseBindingViewModel 

can not be resolved.

hjrb commented 4 months ago

It does actually work. The

<UserControl.DataContext>
    <local:UseBindingViewModel/>
  </UserControl.DataContext>

seems to be not required.