C#, WPF

MainView.xaml

<Metro:MetroWindow
        x:Class="WpfApp21.View.MainView"
        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:local="clr-namespace:WpfApp21.View"
        mc:Ignorable="d"
        Title="MainView" Height="450" Width="800"

        x:Name="viewMainView"
        xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
        xmlns:l="http://schemas.livet-mvvm.net/2011/wpf"
        xmlns:vm="clr-namespace:WpfApp21.ViewModel"
        xmlns:Metro="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
        ShowMaxRestoreButton="False"
        >

    <Window.DataContext>
        <vm:MainViewModel/>
    </Window.DataContext>

    <i:Interaction.Triggers>
        <i:EventTrigger EventName ="StateChanged">
            <l:LivetCallMethodAction MethodTarget="{Binding}" MethodName="OnStateChanged" MethodParameter="{Binding ElementName=viewMainView}" />
        </i:EventTrigger>
    </i:Interaction.Triggers>

    <Grid>
        
    </Grid>
</Metro:MetroWindow>

C#, WPF

MainWindow.xaml

<Window x:Class="WpfApp17.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:local="clr-namespace:WpfApp17"
        mc:Ignorable="d"
        Title="MainWindow" Height="250" Width="400"
        WindowStartupLocation="CenterScreen">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="30"/>
        </Grid.RowDefinitions>

        <TextBox Grid.Row="0" AcceptsReturn="True" Text="{Binding Text}" />
        <Button Grid.Row="1" Content="確認" Click="Button_Click" />
    </Grid>
</Window>

C#, WPF, ソフトウェア開発

ぐらばく氏の「WPF でウィンドウ位置とサイズを保存・復元しよう」を元に
ApplicationSettingsBaseのGradeUp対応を含んだカスタマイズを行った。