File size: 2,685 Bytes
68dd90e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<ui:FluentWindow x:Class="ScreenGrab.Sample.MainWindow"
                 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                 xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
                 xmlns:tray="http://schemas.lepo.co/wpfui/2022/xaml/tray"
                 mc:Ignorable="d"
                 Loaded="MainWindow_OnLoaded"
                 Unloaded="MainWindow_OnUnloaded"
                 WindowStartupLocation="CenterScreen"
                 Title="ScreenGrab Sample" Height="450" Width="800">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="38" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <ui:TitleBar Title="ScreenGrab Sample" />
        <tray:NotifyIcon Grid.Row="0"
                         FocusOnLeftClick="True"
                         Icon="nuget.png"
                         LeftClick="NotifyIcon_OnLeftClick"
                         MenuOnRightClick="True"
                         TooltipText="ScreenGrab.Sample">
            <tray:NotifyIcon.Menu>
                <ContextMenu>
                    <MenuItem Header="Grab"
                              Click="Capture_Click"
                              InputGestureText="Win+Shift+A">
                        <MenuItem.Icon>
                            <ui:SymbolIcon Symbol="Screenshot24" />
                        </MenuItem.Icon>
                    </MenuItem>
                    <Separator />
                    <MenuItem Header="Exit"
                              Click="MenuItem_OnClick">
                        <MenuItem.Icon>
                            <ui:SymbolIcon Symbol="PictureInPictureExit24" />
                        </MenuItem.Icon>
                    </MenuItem>
                </ContextMenu>
            </tray:NotifyIcon.Menu>
        </tray:NotifyIcon>
        <ui:Card Grid.Row="1" Margin="8">
            <StackPanel Orientation="Horizontal">
                <Button Margin="2 0" Content="Capture(Win+Shift+A)" Click="Capture_Click" />
                <Button Margin="2 0" Content="Clean" Click="Clean_Click" />
                <CheckBox Margin="2 0" Content="Auxiliary" Name="AuxiliaryCb" />
            </StackPanel>
        </ui:Card>
        <ui:DynamicScrollViewer Grid.Row="2" Margin="8">
            <Image x:Name="Img" />
        </ui:DynamicScrollViewer>
    </Grid>
</ui:FluentWindow>