spiegelp / MaterialDesignExtensions

Material Design Extensions is based on Material Design in XAML Toolkit to provide additional controls and features for WPF apps
https://spiegelp.github.io/MaterialDesignExtensions/
MIT License
754 stars 122 forks source link

Bug: Commands trigger only once in Stepper. #168

Open saklanmaz opened 2 years ago

saklanmaz commented 2 years ago

Hello, I am making an application as follows. Only the first time I write the code, command is triggered once. It is not triggered afterwards. It didn't make much sense, I don't understand why.

CancelCommand does not work when I close the application and open it again.

      <materialDesign:DialogHost IsOpen="{Binding LipoTestStepperIsOpen}">
            <materialDesign:DialogHost.DialogContent >
                <mde:TabControlStepper IsLinear="False" Layout="Horizontal">
                    <TabItem>
                        <TabItem.Header>
                            <model:StepTitleHeader FirstLevelTitle="What is a Stepper?" />
                        </TabItem.Header>
                        <StackPanel Orientation="Vertical">
                            <TextBlock Text="Steppers are handy to break a big task into smaller parts. These are so called steps. It displays the progress of the full task as a numbered sequence of steps." TextWrapping="WrapWithOverflow" />
                            <mde:StepButtonBar Continue="CONTINUE" Cancel="CANCEL"
                                               CancelCommand="{Binding LipoTestStepperCancelCommand}"/>
                        </StackPanel>
                    </TabItem>
                    <TabItem>
                        <TabItem.Header>
                            <model:StepTitleHeader FirstLevelTitle="Layout and navigation" />
                        </TabItem.Header>
                        <StackPanel Orientation="Vertical">
                            <TextBlock Text="There a two layouts for a Stepper, namely horizontal and vertical. It can be set by using the Layout property." TextWrapping="WrapWithOverflow" />
                            <TextBlock Margin="0,16,0,0" Text="Additionally the Stepper will be in linear mode by setting the IsLinear property to true. This means that the user can only edit the steps in their fixed order. A non-linear Stepper allows the user to edit the steps in any order." TextWrapping="WrapWithOverflow" />
                            <TextBlock Margin="0,16,0,0" Text="The basic navigation inside a stepper will be accomplished by using simple back and continue buttons. They allow the user to browse through the steps in their order. Just use the StepButtonBar like this tutorial to avoid the nasty reimplementation on your own. The user may also switch the steps of a non-linear Stepper by clicking on the headers. " TextWrapping="WrapWithOverflow" />
                            <mde:StepButtonBar Back="BACK" Continue="CONTINUE" Cancel="CANCEL" />
                        </StackPanel>
                    </TabItem>
                    <TabItem>
                        <TabItem.Header>
                            <model:StepTitleHeader FirstLevelTitle="Conclusion" />
                        </TabItem.Header>
                        <StackPanel>
                            <TextBlock Text="Well, that's all to say about this simple stepper version." />
                            <mde:StepButtonBar Back="BACK" Continue="FINISH" Cancel="CANCEL" />
                        </StackPanel>
                    </TabItem>
                </mde:TabControlStepper>
            </materialDesign:DialogHost.DialogContent>
        </materialDesign:DialogHost>
  public RelayCommand LipoTestStepperCancelCommand { get; set; }

 LipoTestStepperCancelCommand = new RelayCommand(LipoTestStepperCancel);

 private void LipoTestStepperCancel(object param)
        {
            LipoTestStepperIsOpen = false;
        }

MaterialDesignExtensions Version 3.3.0