Skip to content

Instantly share code, notes, and snippets.

@hilapon
hilapon / gist:11c1980b7bc6d7ec2d679d0255b1a5f5
Created April 22, 2022 03:13
MAUI のインストール
sudo dotnet workload install maui
@hilapon
hilapon / MainPage.xaml.cs
Last active April 19, 2022 04:33
MainPage のコードビハインド
namespace MauiApp1;
public partial class MainPage : ContentPage {
int count = 0;
public MainPage() {
InitializeComponent();
}
private void OnCounterClicked(object sender, EventArgs e) {
@hilapon
hilapon / ModeConverter.vb
Created April 21, 2017 08:57
[WPF] ComboBox と Enum のバインドのサンプル (列挙体とコンバーター・VB版)
Option Explicit On
Option Strict On
Imports System.ComponentModel
Imports System.Globalization
Imports System.Runtime.CompilerServices
Public Enum SampleEnum
<Description("なし")>
None
@hilapon
hilapon / MainWindow.xaml
Created April 21, 2017 08:55
[WPF] ComboBox と Enum のバインドのサンプル (View)
<Window.Resources>
<ObjectDataProvider x:Key="sampleenums" MethodName="GetValues" ObjectType="{x:Type local:SampleEnum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="local:SampleEnum"/>
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<local:ModeConverter x:Key="modeConverter"/>
</Window.Resources>
<Grid>
<ComboBox x:Name="comboBox" Height="26" Width="150"
@hilapon
hilapon / MainWindow.xaml.cs
Last active March 16, 2017 05:01
DotNetBrowser のサンプルコード(コードビハインド)
using System.Windows;
namespace DotNetBrowserSample {
public partial class MainWindow : Window {
public MainWindow() {
InitializeComponent();
}
private void Button_Click(object sender, RoutedEventArgs e) {
browser.Browser.LoadURL(textBox.Text);
@hilapon
hilapon / MainWindow.xaml
Created March 16, 2017 04:22
DotNetBrowser のサンプルコード(XAML)
<Window x:Class="DotNetBrowserSample.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:browser="clr-namespace:DotNetBrowser.WPF;assembly=DotNetBrowser"
Title="DotNetBrowserSample" >
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="24"/>
<RowDefinition />
</Grid.RowDefinitions>
@hilapon
hilapon / MainWindow.xaml.cs
Created March 3, 2017 06:25
レコードのフィルタリングのサンプル(其の参)
using Infragistics.Windows.DataPresenter;
using Infragistics.Windows.DataPresenter.Events;
/// <summary>
/// レコードのフィルタリング完了時のイベント
/// </summary>
private void XamDataGrid_RecordFilterChanged(object sender, RecordFilterChangedEventArgs e) {
// 保留中の変更を適用します
e.RecordFilter.ApplyPendingFilter();
@hilapon
hilapon / MainWindow.xaml.cs
Created March 3, 2017 06:07
レコードのフィルタリングのサンプル(其の弐)
using System.Windows.Threading;
using Infragistics.Windows.DataPresenter;
using Infragistics.Windows.DataPresenter.Events;
/// <summary>
/// レコードのフィルタリング完了時のイベント
/// </summary>
private void XamDataGrid_RecordFilterChanged(object sender, RecordFilterChangedEventArgs e) {
// 当方のシステムでは ContextIdle でうまくいった。
@hilapon
hilapon / MainWindow.xaml.cs
Last active March 3, 2017 06:08
レコードのフィルタリングのサンプル(其の壱)
using Infragistics.Windows.DataPresenter;
using Infragistics.Windows.DataPresenter.Events;
/// <summary>
/// レコードのフィルタリング完了時のイベント(必要箇所のみ抜粋)
/// </summary>
private void XamDataGrid_RecordFilterChanged(object sender, RecordFilterChangedEventArgs e) {
var presenter = sender as DataPresenterBase;
if (presenter != null) {
@hilapon
hilapon / MainWindow.xaml.cs
Created February 25, 2017 04:56
XamDockManager のレイアウトを保存・読み込み・初期化するサンプル (コードビハインド)
using System;
using System.Windows;
namespace PersistenceSample2.Views {
public partial class MainWindow : Window {
private string _defaultLayout = "";
private string _saveLayout = "";
public MainWindow() {
InitializeComponent();