Added size observer to enable auto-centering the editor at some point

This commit is contained in:
SpoinkyNL committed 2019-11-26 23:24:54 +01:00
1 parent 8161f19f6c
commit 079e88f91f
5 files changed
+85 -46

No files matched your search

@@ -6,6 +6,7 @@
xmlns:s="https://github.com/canton7/Stylet"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:profileEditor="clr-namespace:Artemis.UI.Screens.Module.ProfileEditor.Visualization"
xmlns:observers="clr-namespace:Artemis.UI.Observers"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"
d:DataContext="{d:DesignInstance {x:Type profileEditor:ProfileViewModel}}">
@@ -42,7 +43,10 @@
MouseUp="{s:Action EditorGridMouseClick}"
MouseDown="{s:Action EditorGridMouseClick}"
MouseMove="{s:Action EditorGridMouseMove}"
Cursor="{Binding Cursor}">
Cursor="{Binding Cursor}"
observers:SizeObserver.Observe="True"
observers:SizeObserver.ObservedWidth="{Binding PanZoomViewModel.CanvasWidth, Mode=OneWayToSource}"
observers:SizeObserver.ObservedHeight="{Binding PanZoomViewModel.CanvasHeight, Mode=OneWayToSource}">
<Grid.Background>
<VisualBrush TileMode="Tile" Stretch="Uniform" Viewport="{Binding PanZoomViewModel.BackgroundViewport}" ViewportUnits="Absolute">