Bonjour Jean-François,
Voici le code XAML :
<Page
x:Class="App6.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:App6"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<StackPanel>
<PasswordBox x:Name="txtPasswork" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<Button x:Name="btnValidate"
Tapped="btnValidate_Tapped" />
</StackPanel>
</Grid>
</Page>
Et le code C #
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
namespace App6
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
}
private void btnValidate_Tapped(object sender, TappedRoutedEventArgs e)
{
if (txtPasswork.Password.Length==8)
{
//Faire le traitement approprié
}
}
}
}
J'espère que j'ai bien répondu à votre question.
Si c'est le cas, n'hésitez pas à mettre ma réponse
en réponse à votre post
Vous pouvez me suivre sur Twitter : https://twitter.com/NordineMhoumadi
Download my NEW FREE application MCP PREPARATION in the Windows 10 Store for preparing your Microsoft Certification or test your skills in Microsoft Technologies;