WPF を使用するときに常に困惑することの 1 つは、命名規則です。
だから、これは私がXAMLのために持っているものです:
<StatusBar Grid.Row="2" MinHeight="20" Name="StatusBar">
        <StatusBarItem>
            <Border BorderBrush="Black" BorderThickness=".25,.25,0,0">
                <Border BorderBrush="White" BorderThickness="0,0,.25,.25">
                    <TextBlock Name="StatusBarText" Margin="2,2,2,2" >Ready</TextBlock>
                </Border>
            </Border>
        </StatusBarItem>
        <StatusBarItem>
            <Border BorderBrush="Black" BorderThickness=".25,.25,0,0">
                <Border BorderBrush="White" BorderThickness="0,0,.25,.25">
                    <TextBlock Name="FilePathText" Margin="2,2,2,2" >File Path</TextBlock>
                </Border>
            </Border>
        </StatusBarItem>
    </StatusBar>
TextBlock のコンテンツはデータバインドされます。潜在的なあいまいさを避けるために、UI 要素とプロパティに名前を付ける方法が本当にわかりません。
    public string StatusBarText 
   //Maybe StatusText instead of StatusBarText since this 
   //indicates the current status of the application (Ready,Running,Error etc)?
    {
        get { return statusBarText; }
        set
        {
            statusBarText = value;
            NotifyOfPropertyChange(() => StatusBarText);
        }
    }
    public string FilePathText
    {
        get { return filePathText; }
        set
        {
            filePathText = value;
            NotifyOfPropertyChange(() => filePathText);
        }
    }
つまり、プロパティの名前は問題ありませんか? 別の人がこれらのプロパティ名を調べた場合、それらの文字列が StatusBar テキストブロックに使用されていることを理解する方法がないように感じます。ハンガリー語の記法がこの問題を解決するかもしれないと思いますが、最近ではそれが良い考えだと考える人は多くありません.
あなたの提案は何ですか?