wpf
最近xmalコーディングばかりなので、xamlでのスタイルの適用について書きます。 まずは、x:Keyを使用してのスタイルの適用。 x:Keyでスタイルを定義し、StaticResourceでスタイルを適用されます。 <Window.Resources> <style> <Setter Property="Width" Value="100" /> <Setter Proper</style></window.resources>…
WPFの画面でジェネリック・クラスを継承させることってできるのかな? と思い調べてみたらできました。 こんな感じです。 まず、継承させるジェネリック・クラスを作成します。 namespace WpfBaseWindow { public abstract class BaseWindow<T> : System.Window</t>…
初登板ホリノウチです。 WPFでDataGridからDataGridRowの取得にはContainerFromIndexやContainerFromItemがあります。 (環境: Windows7, .net framework4, C#, wpf) DataGridRow row = (DataGridRow)grid.ItemContainerGenerator.ContainerFromIndex(index);…