diff --git a/samples/XamlTestApplicationPcl/GridSplitter.paml b/samples/XamlTestApplicationPcl/GridSplitter.paml new file mode 100644 index 0000000000..ee0757a3f5 --- /dev/null +++ b/samples/XamlTestApplicationPcl/GridSplitter.paml @@ -0,0 +1,8 @@ + \ No newline at end of file diff --git a/samples/XamlTestApplicationPcl/Menu.paml b/samples/XamlTestApplicationPcl/Menu.paml new file mode 100644 index 0000000000..c6dd95c7ce --- /dev/null +++ b/samples/XamlTestApplicationPcl/Menu.paml @@ -0,0 +1,15 @@ + \ No newline at end of file diff --git a/samples/XamlTestApplicationPcl/MenuItem.paml b/samples/XamlTestApplicationPcl/MenuItem.paml new file mode 100644 index 0000000000..68d4602a92 --- /dev/null +++ b/samples/XamlTestApplicationPcl/MenuItem.paml @@ -0,0 +1,131 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/samples/XamlTestApplicationPcl/Views/MainWindow.paml b/samples/XamlTestApplicationPcl/Views/MainWindow.paml index c5ff9f4adc..bb359d9d3b 100644 --- a/samples/XamlTestApplicationPcl/Views/MainWindow.paml +++ b/samples/XamlTestApplicationPcl/Views/MainWindow.paml @@ -4,221 +4,229 @@ xmlns:vm="clr-namespace:XamlTestApplication.ViewModels;assembly=XamlTestApplicationPcl" Title="Perspex Test Application" Width="800" Height="600"> - - - - - - - - - - + - - - - - - - + + + + + + + - + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/samples/XamlTestApplicationPcl/XamlTestApp.paml b/samples/XamlTestApplicationPcl/XamlTestApp.paml index 1a8fbd5e41..6bec14667f 100644 --- a/samples/XamlTestApplicationPcl/XamlTestApp.paml +++ b/samples/XamlTestApplicationPcl/XamlTestApp.paml @@ -7,9 +7,12 @@ + + + diff --git a/samples/XamlTestApplicationPcl/XamlTestApplicationPcl.csproj b/samples/XamlTestApplicationPcl/XamlTestApplicationPcl.csproj index 040b5360d5..7d9af8749d 100644 --- a/samples/XamlTestApplicationPcl/XamlTestApplicationPcl.csproj +++ b/samples/XamlTestApplicationPcl/XamlTestApplicationPcl.csproj @@ -172,6 +172,15 @@ Designer + + Designer + + + Designer + + + Designer + Designer diff --git a/src/Markup/Perspex.Markup/Data/ExpressionObserver.cs b/src/Markup/Perspex.Markup/Data/ExpressionObserver.cs index 62e230e843..8f1d247e55 100644 --- a/src/Markup/Perspex.Markup/Data/ExpressionObserver.cs +++ b/src/Markup/Perspex.Markup/Data/ExpressionObserver.cs @@ -76,7 +76,7 @@ namespace Perspex.Markup.Data try { - return _node.SetValue(value); + return _node?.SetValue(value) ?? false; } finally { @@ -101,7 +101,14 @@ namespace Perspex.Markup.Data try { - return (Leaf as PropertyAccessorNode)?.PropertyType; + if (_node != null) + { + return (Leaf as PropertyAccessorNode)?.PropertyType; + } + else + { + return _root()?.GetType(); + } } finally { diff --git a/src/Perspex.Controls/MenuItem.cs b/src/Perspex.Controls/MenuItem.cs index 24f4aa3a4b..dde7dc16b3 100644 --- a/src/Perspex.Controls/MenuItem.cs +++ b/src/Perspex.Controls/MenuItem.cs @@ -380,7 +380,7 @@ namespace Perspex.Controls { base.OnTemplateApplied(); - _popup = this.GetTemplateChild("popup"); + _popup = this.GetTemplateChild("PART_Popup"); _popup.DependencyResolver = DependencyResolver.Instance; _popup.PopupRootCreated += PopupRootCreated; _popup.Opened += PopupOpened; diff --git a/src/Perspex.Themes.Default/MenuItemStyle.cs b/src/Perspex.Themes.Default/MenuItemStyle.cs index 16871a7b3b..ff0b865cdf 100644 --- a/src/Perspex.Themes.Default/MenuItemStyle.cs +++ b/src/Perspex.Themes.Default/MenuItemStyle.cs @@ -104,7 +104,7 @@ namespace Perspex.Themes.Default }, (popup = new Popup { - Name = "popup", + Name = "PART_Popup", StaysOpen = true, [!!Popup.IsOpenProperty] = control[!!MenuItem.IsSubMenuOpenProperty], Child = new Border