فهرست منبع

set binding mode in xaml

Dan Walmsley 6 سال پیش
والد
کامیت
65a47c845e
2فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 1 1
      samples/ControlCatalog/MainWindow.xaml
  2. 1 1
      src/Avalonia.Controls/TopLevel.cs

+ 1 - 1
samples/ControlCatalog/MainWindow.xaml

@@ -5,7 +5,7 @@
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:vm="clr-namespace:ControlCatalog.ViewModels"
         xmlns:v="clr-namespace:ControlCatalog.Views"
-        x:Class="ControlCatalog.MainWindow" LocalNotificationManager="{Binding NotificationManager}">
+        x:Class="ControlCatalog.MainWindow" LocalNotificationManager="{Binding NotificationManager, Mode=OneWayToSource}">
     <Window.DataTemplates>
         <DataTemplate DataType="vm:NotificationViewModel">
             <v:NotificationView />

+ 1 - 1
src/Avalonia.Controls/TopLevel.cs

@@ -52,7 +52,7 @@ namespace Avalonia.Controls
         /// Defines the <see cref="LocalNotificationManager"/> property.
         /// </summary>
         public static readonly DirectProperty<TopLevel, INotificationManager> LocalNotificationManagerProperty =
-            AvaloniaProperty.RegisterDirect<TopLevel, INotificationManager>(nameof(LocalNotificationManager), o => o.LocalNotificationManager, defaultBindingMode: Data.BindingMode.OneWayToSource);
+            AvaloniaProperty.RegisterDirect<TopLevel, INotificationManager>(nameof(LocalNotificationManager), o => o.LocalNotificationManager);
 
         /// <summary>
         /// Defines the <see cref="SystemNotificationManager"/> property.