capture close function

main
syneffort 2 years ago
parent bf67edb4cc
commit 65c724abc2
  1. 10
      PacticeSolution/Capture/MainWindow.xaml
  2. 5
      PacticeSolution/Capture/MainWindow.xaml.cs
  3. 1
      PacticeSolution/Capture/OptionContext.cs

@ -20,6 +20,14 @@
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Border BorderThickness="{Binding FrameThickness}" BorderBrush="{Binding FrameColor}"/> <Border BorderThickness="{Binding FrameThickness}" BorderBrush="{Binding FrameColor}"/>
<Button x:Name="btnCapture" Grid.Row="1" Content="Capture" Click="btnCapture_Click"/> <Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="{Binding CloseButtonWidth}"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Button x:Name="btnClose" Grid.Column="0" Content="❎" Click="btnClose_Click"/>
<Button x:Name="btnCapture" Grid.Column="1" Content="Capture" Click="btnCapture_Click"/>
</Grid>
</Grid> </Grid>
</Window> </Window>

@ -80,5 +80,10 @@ namespace Capture
this.DragMove(); this.DragMove();
} }
private void btnClose_Click(object sender, RoutedEventArgs e)
{
Application.Current.Shutdown();
}
} }
} }

@ -10,6 +10,7 @@ namespace Capture
public class OptionContext public class OptionContext
{ {
public int ButtonHeight { get; set; } = 20; public int ButtonHeight { get; set; } = 20;
public int CloseButtonWidth { get; set; } = 20;
public Brush FrameColor { get; set; } = Brushes.Red; public Brush FrameColor { get; set; } = Brushes.Red;
public int FrameThickness { get; set; } = 2; public int FrameThickness { get; set; } = 2;
} }

Loading…
Cancel
Save