Skip to content

Commit

Permalink
Device no resizing
Browse files Browse the repository at this point in the history
  • Loading branch information
mgth committed Mar 2, 2016
1 parent bbf1348 commit b5f9b6f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
13 changes: 5 additions & 8 deletions LittleBigMouse_Control/LocationPlugin/LocationScreenView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,17 @@
<local:ScaleConverter x:Key="Scale" />
</UserControl.Resources>

<Grid Grid.Column="1" Grid.Row="1" x:Name="grid" SizeChanged="OnSizeChanged">
<Grid x:Name="grid" SizeChanged="OnSizeChanged">

<Border BorderThickness="0" Background="{StaticResource ScreenColor}"/>
<!-- Central Device No -->
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<Border x:Name="center"
<Border x:Name="center"
Height ="100"
Width ="100"
BorderThickness = "{Binding Path=ActualHeight, ElementName=center, Converter={StaticResource Scale},ConverterParameter=0.05}"
CornerRadius= "{Binding Path=ActualHeight, ElementName=center, Converter={StaticResource Scale},ConverterParameter=0.5}"

Width="{Binding Path=ActualHeight, ElementName=grid, Converter={StaticResource Scale},ConverterParameter=0.5}"
Height="{Binding Path=ActualHeight, ElementName=grid, Converter={StaticResource Scale},ConverterParameter=0.5}"


Background="{Binding Screen.Selected, Converter={StaticResource Highlighter}, FallbackValue={StaticResource UnselectedBrush}}"
BorderBrush="#FFD9DCEC">
<Label
Expand All @@ -67,8 +66,6 @@
HorizontalAlignment="Left"
VerticalAlignment="{Binding Path=PnpNameVerticalAlignment}"
Foreground="#FFD9DCEC"/>
<Label ContentStringFormat="#0" Content="{Binding Screen.SystemScaleFactor, FallbackValue=xxx}"/>
<Label ContentStringFormat="#0.00" Content="{Binding Screen.ScaleFactor, FallbackValue=x.xx}"/>
</StackPanel>
<!-- Y Position -->
<TextBox
Expand Down
14 changes: 8 additions & 6 deletions LittleBigMouse_Control/LocationPlugin/LocationScreenView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,16 @@ private void OnSizeChanged1(object sender, SizeChangedEventArgs sizeChangedEvent

private LocationScreenViewModel ViewModel => (DataContext as LocationScreenViewModel);

/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void OnSizeChanged(object sender, SizeChangedEventArgs e)
{
//center.Height = Math.Min(grid.ActualHeight, grid.ActualWidth) / 3;
//center.Width = center.Height;
//center.CornerRadius = new CornerRadius(center.Height / 2);

//if (center.Height > 0)
// lblName.FontSize = center.Height / 2;
double size = Math.Min(grid.ActualHeight, grid.ActualWidth) / 3;
center.Height = size;
center.Width = size;
}


Expand Down

0 comments on commit b5f9b6f

Please sign in to comment.