none
Button event non fonctionnel dans WPF

    Question

  • Bonjour,

    J'ai créé une fenêtre de dialogue, dans laquelle je dois rentrer des paramètres, puis de valider par un bouton.

    Mais le bouton ne fonctionne pas, l'event "ConvertButton_MouseLeftButtonUp" n'est jamais généré ... Qu'est-ce qui peut bien se passer ?

    Voici le code XAML :

    <Window x:Class="YedToSmag.ExportConfig"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
            xmlns:local="clr-namespace:YedToSmag"
            mc:Ignorable="d"
            Title="SMAG Export Configuration" Height="220" Width="640" WindowStyle="ToolWindow" ResizeMode="NoResize" Topmost="True" WindowStartupLocation="CenterScreen">
        <Grid>
            <Grid.Background>
                <SolidColorBrush Color="{DynamicResource BackgroundColor}"/>
            </Grid.Background>
            <DockPanel>
                <StackPanel DockPanel.Dock="Top" Width="590" Margin="0,20,0,0">
                    <Label Content="State Machine Name" />
                    <TextBox x:Name="MachineName" />
                </StackPanel>
    
                <StackPanel DockPanel.Dock="Top" Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,20,0,0">
                    <StackPanel Width="140" Margin="0,0,5,0">
                        <Label Content="Number Of Instantiation" HorizontalAlignment="Center" />
                        <TextBox x:Name="MachineNbInstantiation" />
                    </StackPanel>
    
                    <StackPanel Width="140" Margin="5,0">
                        <Label Content="State FIFO Size For Debug" HorizontalAlignment="Center" />
                        <TextBox x:Name="MachineFIFOSizeDebug" />
                    </StackPanel>
    
                    <StackPanel Width="140" Margin="5,0">
                        <Label Content="Event FIFO Size" HorizontalAlignment="Center" />
                        <TextBox x:Name="MachineFIFOSize" />
                    </StackPanel>
    
                    <StackPanel Width="140" Margin="5,0,0,0">
                        <Label Content="State Machine Identifier" HorizontalAlignment="Center" />
                        <TextBox x:Name="MachineID" />
                    </StackPanel>
                </StackPanel>
    
                <Button x:Name="ConvertButton" DockPanel.Dock="Bottom" Content="Convert" IsDefault="True" Width="75" Height="25" Margin="0,20" MouseLeftButtonUp="ConvertButton_MouseLeftButtonUp"  />
    
            </DockPanel>
        </Grid>
    </Window>
    


    vendredi 21 octobre 2016 13:34

Réponses

Toutes les réponses