Browse Source

Merge branch 'master' into fixes/787-contentpresenter-updatechild

danwalmsley 8 years ago
parent
commit
4ec230b0b1

+ 1 - 1
docs/tutorial/from-wpf.md

@@ -33,7 +33,7 @@ placed in a `DataTemplates` collection on each control (and on `Application`):
                     <TextBox Text="{Binding Name}"/>
                 </Border>
             </DataTemplate>
-        </UserControl.Styles>
+        </UserControl.DataTemplates>
         <!-- Assuming that DataContext.Foo is an object of type
              MyApp.ViewModels.FooViewModel then a red border with a corner
              radius of 8 containing a TextBox will be displayed here -->

+ 1 - 1
src/Gtk/Avalonia.Gtk3/Interop/GObject.cs

@@ -41,7 +41,7 @@ namespace Avalonia.Gtk3.Interop
 
     class GtkWindow : GtkWidget
     {
-        
+        public static GtkWindow Null { get; } = new GtkWindow();
     }
 
     class GtkImContext : GObject

+ 2 - 0
src/Gtk/Avalonia.Gtk3/Interop/Utf8Buffer.cs

@@ -11,6 +11,8 @@ namespace Avalonia.Gtk3.Interop
             
         public Utf8Buffer(string s) : base(IntPtr.Zero, true)
         {
+            if (s == null)
+                return;
             _data = Encoding.UTF8.GetBytes(s);
             _gchandle = GCHandle.Alloc(_data, GCHandleType.Pinned);
             handle = _gchandle.AddrOfPinnedObject();

+ 2 - 1
src/Gtk/Avalonia.Gtk3/SystemDialogs.cs

@@ -18,7 +18,8 @@ namespace Avalonia.Gtk3
             bool multiselect, string initialFileName)
         {
             GtkFileChooser dlg;
-            using (var name = title != null ? new Utf8Buffer(title) : null)
+            parent = parent ?? GtkWindow.Null;
+            using (var name = new Utf8Buffer(title))
                 dlg = Native.GtkFileChooserDialogNew(name, parent, action, IntPtr.Zero);
             if (multiselect)
                 Native.GtkFileChooserSetSelectMultiple(dlg, true);