私がしたいことは、その中にProgressBarを含むボタンと、アイコンバーがいっぱいです、私はチェックボックス/トグルボタンのようなアイコンを持っているボタンに切り替えたい、それは複数の状態を持っています、私はそれを変更すると、コントロールを変更します。コントロールのWPF同じ場所で2つのコントロールを切り替えます
画像例:
OBS:コントロールはMahApps
OBS2を使用して、タイトルバーコントロールにあります。私は素晴らしいMVVM
XAML例:
<Button FontSize="15"
FontWeight="Bold"
cal:Message.Attach="UpdateStatus"
ToolTip="Click here to show the update status."
Visibility="Visible">
<ProgressBar Style="{StaticResource MaterialDesignCircularProgressBar}"
Value="0"
IsIndeterminate="True"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Height="22"
Width="22" Foreground="White"/>
</Button>
<Button FontSize="15"
FontWeight="Bold"
cal:Message.Attach="Restart"
ToolTip="A update is scheduled, click here to restart the loader and apply the update."
Visibility="{Binding Path=RestartButtonVisibility, Mode=TwoWay}">
<materialDesign:PackIcon Height="22"
Width="22"
Kind="Cached"
FontWeight="Bold"/>
</Button>
をすることが可能ですそれをコンパイルする?それを達成するためのスパゲッティではない良い方法がありますか?
'return(double)value <100? Visibility.Visible'、または 'return(double)value <100? Visibility.Hidden:Visibility.Visible'を使用して、レイアウトを事前に実行したい場合に使用します。コンバータが逆変換をサポートしていない場合、NotSupportedExceptionをスローします。ちょっと細心の注意が必要です。 – Clemens
お互いのおかげで、グリッドトリックは問題を起こしましたが、Visibilityの変更を別の方法で処理します。 –