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

MainWindow.xaml

<Window x:Class="WpfApp15.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:WpfApp15"
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="400">
    <Grid>
        <ListView Margin="30" ItemsSource="{Binding arrayString}">
            
            <ListView.ItemContainerStyle>
                <Style TargetType="ListViewItem">
                    <Setter Property="HorizontalContentAlignment" Value="Stretch" />
                </Style>
            </ListView.ItemContainerStyle>

            <ListView.ItemTemplate>
                <DataTemplate>
                    <Button Height="50" Content="{Binding}"/>
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>
    </Grid>
</Window>

C#,WPF

今回お借りしたフォント
源真ゴシック (げんしんゴシック) | 自家製フォント工房

プロジェクト

Fontフォルダを作成し、フォントファイルを格納
ビルドアクションはResource
(例としてFontフォルダにしている 他のフォルダ名でもOK)

C#,WPF

UpdateSourceTrigger=PropertyChanged を付けることで、入力後即時反映される。

<TextBox Text="{Binding Url, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
    <i:Interaction.Triggers>
        <i:EventTrigger EventName="TextChanged">
            <l:LivetCallMethodAction MethodTarget="{Binding}" MethodName="OnURLChanged" />
        </i:EventTrigger>
    </i:Interaction.Triggers>
</TextBox>

jQuery/JavaScript

async: false を入れることで同期処理となる

$.ajax({
	type: "GET",
	url: "https://xxxxxxxxxxxx",
	async: false,
	cache: false.
	dataType: "json",
	data: {
		sei: "Yamada",
		mei: "Hanako"
	}
})
.done(function(data, textStatus, jqXHR) {
})
.fail(function(jqXHR, textStatus, errorThrown) {
})
.always(function() {
});

参考: jQuery.ajax() | jQuery API Documentation

jQuery/JavaScript

jQueryオブジェクト→DOM

var objDom = objJQuery[0];

DOM→jQueryオブジェクト

var objJQuery = $(objDom);

C#,WPF

MainView.xaml

<Controls:MetroWindow 
        x:Class="WpfApp12.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:WpfApp12.View"
        mc:Ignorable="d"
        
        xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
        xmlns:ei="http://schemas.microsoft.com/xaml/behaviors"
        xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
        xmlns:l="http://schemas.livet-mvvm.net/2011/wpf"
        xmlns:vm="clr-namespace:WpfApp12.ViewModel"
        
        xmlns:Dialog="clr-namespace:MahApps.Metro.Controls.Dialogs;assembly=MahApps.Metro"
        Dialog:DialogParticipation.Register="{Binding}"
        
        TextElement.Foreground="{DynamicResource MaterialDesignBody}"
        TextElement.FontWeight="Regular"
        TextElement.FontSize="13"
        TextOptions.TextFormattingMode="Ideal" 
        TextOptions.TextRenderingMode="Auto"        
        Background="{DynamicResource MaterialDesignPaper}"
        FontFamily="{DynamicResource MaterialDesignFont}"
        ResizeMode="CanResizeWithGrip"
        WindowStartupLocation="CenterScreen"
        GlowBrush="{DynamicResource AccentColorBrush}"
        WindowTransitionsEnabled="False"
        TitleCharacterCasing="Normal"
        ShowIconOnTitleBar="True"
        
        Title="MainView" Height="450" Width="800">

    <Window.DataContext>
        <vm:MainViewModel>
            <vm:MainViewModel.MahAppsDialogCoordinator>
                <Dialog:DialogCoordinator/>
            </vm:MainViewModel.MahAppsDialogCoordinator>
        </vm:MainViewModel>
    </Window.DataContext>

    <Grid>

        <Button Content="MessageBox" Margin="10,10,657,359" Height="Auto">
            <i:Interaction.Triggers>
                <i:EventTrigger EventName="Click">
                    <l:LivetCallMethodAction MethodTarget="{Binding}" MethodName="ShowMessageBox" />
                </i:EventTrigger>
            </i:Interaction.Triggers>
        </Button>
        
        <Button Content="Progress" Margin="155,10,512,359" Height="Auto">
            <i:Interaction.Triggers>
                <i:EventTrigger EventName="Click">
                    <l:LivetCallMethodAction MethodTarget="{Binding}" MethodName="ShowProgress" />
                </i:EventTrigger>
            </i:Interaction.Triggers>
        </Button>

    </Grid>
</Controls:MetroWindow>

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

VisualStudio2019から、BlendSDKが提供されなくなった為、
Microsoft.Xaml.Behaviors.Wpfへ移行する必要がある。

BlendSDK

xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"

Microsoft.Xaml.Behaviors.Wpf

xmlns:ei="http://schemas.microsoft.com/xaml/behaviors"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"

詳細
Open Sourcing XAML Behaviors for WPF | .NET Blog