Keboo on icons
Icons update from Azure pipeline (compare)
Keboo on icons
Icons update from Azure pipeline (compare)
Keboo on icons
Icons update from Azure pipeline (compare)
Keboo on icons
Icons update from Azure pipeline (compare)
@PRobinsom_twitter
View:
<md:Transitioner SelectedIndex="{Binding SelectedTransitionIndex}">
<controls:MyUserControl1 />
<controls:MyUserControl2 />
</md:Transitioner>
And you can add AutoApplyTransitionOrigins="True" to enable auto-detect if ripple/transition origin when click on buttons or controls - just animations.
In MyUserControl1 control:
<Button Command={Binding SwitchToSecondFrameCommand} />
In MyUserControl2 control:
<Button Command={Binding SwitchToFirstFrameCommand} />
ViewModel:
private int _selectedTransitionIndex;
public int SelectedTransitionIndex
{
get => _selectedTransitionIndex;
set
{
_selectedTransitionIndex = value;
RaisePropertyChanged();
}
}
private RelayCommand _switchToSecondFrameCommand
public RelayCommand SwitchToSecondFrameCommand => _switchToSecondFrameCommand ?? (_switchToSecondFrameCommand = new RelayCommand(SwitchToSecond));
private void SwitchToSecond()
{
SelectedTransitionIndex = 1;
}
private RelayCommand _switchToFirstFrameCommand
public RelayCommand SwitchToFirstFrameCommand => _switchToFirstFrameCommand ?? (_switchToFirstFrameCommand = new RelayCommand(SwitchToFirst));
private void SwitchToFirst()
{
SelectedTransitionIndex = 0;
}
This is minimal set of bindings.
I think need a whole project.
Hi all!
I just upgraded material design lib from 3.2 to 4.0 and found couple of problems.
First, TextBox control paddings can't be overload by style. That doesn't work:
<Style TargetType="TextBox" BasedOn="{StaticResource MaterialDesignOutlinedTextBox}">
<Setter Property="Padding" Value="0"/>
</Style>
But it's ok if I just write it right in control like <TextBox Padding="0"/>
Second, and more important, all menu dropdowns become higher. I dunno how to solve this :< Any ideas?
I have been really impressed with the Material Design In Xaml toolkit. Well done!
Out of curiosity, is there an easy way to only show the list of options (i.e. the popup) for a ComboBox
(IsEditable=True
) when the user clicks the arrow button? I would like to avoid having the popup appear, thus hiding the UI, until the user explicitly asks for a list of options.
Any guidance you can provide would be appreciated.
CONTEXT
Hi @all,
does anyone know how to use a DialogHost on MainWindow's Closing event? I try to show a dialog if there are unsafed changes but nothing happens. No line of code is recognized after the line
var result = await DialogHost.Show("content", "identifier");
The application closes immediately with code 0 and no exception is thrown.
If I grap the task an wait for it, the application hangs.
var t = DialogHost.Show("content", "identifier");
t.Wait();
var result = t.Result;
Taskstatus is WaitingForActivation and nothing happens.
Any advice?
With respect to:
Is there an easy way to only show the list of options (i.e. the popup) for a ComboBox (IsEditable=True) when the user clicks the arrow button?
I don't know if this was the original intent, but it appears that:
toggleButton
is higher up in the visual tree than the PART_EditableTextBox
toggleButton
border you see that the Button
takes up the entire width of the ComboBox
As a result, the toggleButton
will always intercept mouse events. The solution that worked for me was to shorten the button size, and align to the right.
@Erapchu : Thanks for your reply, but I think you have got me wrong. Let me explain it in other words.
Following code is doing what I want but shows the very ugly MessageBox:
private void MainWindowOnClosing(object sender, CancelEventArgs e)
{
if (DataContext is MainWindowViewModel dc && dc.HasUnsavedChanges())
{
e.Cancel = MessageBox.Show(
"Unsaved changes found.\nRevert changes?",
"Revert changes?", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) == MessageBoxResult.No;
}
}
Instead I want to have a Material Design dialog. If I try the following code, no dialog is shown and no break point could be hit after DialogHost.Show(), but application exited with code 0.
private async void MainWindowOnClosing(object sender, CancelEventArgs e)
{
if (DataContext is MainWindowViewModel dc && dc.HasUnsavedChanges())
{
var result = await DialogHost.Show("content", DialogHostNames.ErrorDialogHostName, null, null);
e.Cancel = true; //<-- Break point is not hit
}
}
Maybe it has something to do with the Window because it is about to close but its content is updated. Any ideas? Thanks in advance.
private async void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
e.Cancel = true;
var result = await DialogHost.Show(new UserControl1(), "MainWindowDialogHost");
if (result is bool booleanResult && booleanResult)
{
Closing -= Window_Closing;
Close();
}
}
Hello, all. I am using a MaterialDesignThemes DialogHost as a popup window for a ProgressBar. IsOpen property is binded to a boolean that controls when the DialogHost is opened.
When I start asynchronous method to do some work I am opening the DialogHost to show that the window is busy and at the end of the method I am closing it. The problem is that if I open another window in the meantime and the asynchronous method closes the DialogHost focus is stolen from the new window I am working on. Strange thing is that this doesn't occur if the application is started in debug mode.
<DialogHost IsOpen="{Binding IsOpenProperty}">
<DialogHost.DialogContent>
<ProgressBar/>
</DialogHost.DialogContent>
<DialogHost/>
private async void DoSomeWorkAsync()
{
IsOpenProperty = true;
// Doing some work
IsOpenProperty = false;
}
Do you know why is this happening and how it could be fixed?
<StackPanel Orientation="Horizontal">
<Button Command="{Binding LoadDatabaseCommand}"
Margin="0 0 10 0"
HorizontalAlignment="Stretch"
Style="{StaticResource MaterialDesignFlatAccentBgButton}"
Content="LOAD DATABASE" />
<StackPanel VerticalAlignment="Center">
<materialDesign:PopupBox Padding="0"
StaysOpen="True">
<materialDesign:PopupBox.ToggleContent>
<!--<materialDesign:ColorZone Mode="Accent"
CornerRadius="5"
Padding="8 4 8 4 ">
<StackPanel Margin="0 0 8 0"
Orientation="Horizontal">-->
<materialDesign:PackIcon Kind="Cog"
Width="24"
Height="24"/>
<!--<Label Margin="4 0 0 0"
Content="SETTINGS" />-->
<!--</StackPanel>
</materialDesign:ColorZone>-->
</materialDesign:PopupBox.ToggleContent>
<StackPanel>
<materialDesign:ColorZone Mode="SecondaryLight"
Padding="6 ">
<StackPanel Orientation="Horizontal">
<Button Style="{StaticResource MaterialDesignToolForegroundButton}"
Command="{x:Static materialDesign:PopupBox.ClosePopupCommand}"
HorizontalAlignment="Left">
<materialDesign:PackIcon Kind="CloseThick"
HorizontalAlignment="Right" />
</Button>
<TextBlock Margin="8 0 0 0"
Text="OPTIONS"
VerticalAlignment="Center" />
</StackPanel>
</materialDesign:ColorZone>
<ContentControl Margin="10"
Content="{Binding SettingsView}" />
<Button Style="{StaticResource MaterialDesignFlatAccentBgButton}"
Command="{Binding SaveSettingsCommand}"
HorizontalAlignment="Left"
Margin="16"
Width="150"
Content="SAVE" />
</StackPanel>
</materialDesign:PopupBox>