These are chat archives for AvaloniaUI/Avalonia

11th
Aug 2018
Wiesław Šoltés
@wieslawsoltes
Aug 11 2018 14:29
@_VeTaLkO__twitter
IsVisible="{Binding $self.DataContext, Converter={StaticResource IsNotNullConverter}}"
<UserControl x:Class="Core2D.Avalonia.Views.Containers.DatabasesControl"
             xmlns="https://github.com/avaloniaui"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:converters="clr-namespace:Core2D.Avalonia.Converters;assembly=Core2D.Avalonia">
    <UserControl.Resources>
        <converters:IsNotNullConverter x:Key="IsNotNullConverter"/>
    </UserControl.Resources>
using Avalonia;
using Avalonia.Data.Converters;
using System;
using System.Globalization;

namespace Core2D.Avalonia.Converters
{
    public class IsNotNullConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return value != AvaloniaProperty.UnsetValue && value != null;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
Steven Kirk
@grokys
Aug 11 2018 17:21
You should also be able to use !! right?
theweavr
@theweavrs
Aug 11 2018 17:58
When's the next release coming out? Is there an expected date or something? Really looking forward to getting started with AvaloniaUI.
danwalmsley
@danwalmsley
Aug 11 2018 19:04
See projects - >0.7 blockers on github
(or milestone)
WojciechKrysiak
@WojciechKrysiak
Aug 11 2018 19:12
Is there a safe way to display a dialog from a non-ui thread?
Kyiv
@_VeTaLkO__twitter
Aug 11 2018 19:12
IsVisible="{Binding $self.DataContext, Converter={StaticResource IsNotNullConverter}}"
Thanks a ton!
WojciechKrysiak
@WojciechKrysiak
Aug 11 2018 19:25
ok found a method, not pretty but works
danwalmsley
@danwalmsley
Aug 11 2018 20:54
Dispatcher. UiThread. Post?