aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.SharedUI/Controls
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2020-02-17 22:31:33 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2020-02-17 22:31:33 +0200
commit95c0b0ccb0a1bc60de533464552fcb0c5e44779f (patch)
treec3876a6b03dcf9bb378112571be40231da87c61c /Software/Visual_Studio/Tango.SharedUI/Controls
parenta6ebe1e48de8ba5e4d936c4825060a08f2695785 (diff)
downloadTango-95c0b0ccb0a1bc60de533464552fcb0c5e44779f.tar.gz
Tango-95c0b0ccb0a1bc60de533464552fcb0c5e44779f.zip
Some more work on FSE..
Diffstat (limited to 'Software/Visual_Studio/Tango.SharedUI/Controls')
-rw-r--r--Software/Visual_Studio/Tango.SharedUI/Controls/NavigationControl.cs25
1 files changed, 25 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.SharedUI/Controls/NavigationControl.cs b/Software/Visual_Studio/Tango.SharedUI/Controls/NavigationControl.cs
index 64e2dbf84..0ef8d0ecc 100644
--- a/Software/Visual_Studio/Tango.SharedUI/Controls/NavigationControl.cs
+++ b/Software/Visual_Studio/Tango.SharedUI/Controls/NavigationControl.cs
@@ -184,6 +184,26 @@ namespace Tango.SharedUI.Controls
#region Properties
+
+
+ public object SelectedObject
+ {
+ get { return (object)GetValue(SelectedObjectProperty); }
+ set { SetValue(SelectedObjectProperty, value); }
+ }
+
+ // Using a DependencyProperty as the backing store for SelectedObject. This enables animation, styling, binding, etc...
+ public static readonly DependencyProperty SelectedObjectProperty =
+ DependencyProperty.Register("SelectedObject", typeof(object), typeof(NavigationControl), new PropertyMetadata(null, (d, e) => (d as NavigationControl).OnSelectedObjectChanged()));
+
+ private void OnSelectedObjectChanged()
+ {
+ if (SelectedObject != null)
+ {
+ NavigateTo(SelectedObject);
+ }
+ }
+
public ObservableCollection<FrameworkElement> Elements
{
get { return (ObservableCollection<FrameworkElement>)GetValue(ElementsProperty); }
@@ -623,6 +643,11 @@ namespace Tango.SharedUI.Controls
return NavigateTo(navigationName, null);
}
+ public FrameworkElement NavigateTo(Object obj)
+ {
+ return NavigateTo(obj.ToString(), null);
+ }
+
public FrameworkElement NavigateTo(String navigationName, Action onCompleted = null)
{
Action completed = null;