Feat : Contentview pas fini
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
b680784294
commit
5f4051d56f
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:local="clr-namespace:Stim"
|
||||
x:Class="Stim.UserInfo"
|
||||
x:Name="userInfoView">
|
||||
<Grid Margin="0,20,0,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="10*"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Border Margin="0,10,0,0" Padding="0">
|
||||
<Label Text="{Binding Path=Bind, Source={x:Reference userInfoView}}" />
|
||||
</Border>
|
||||
<Button ImageSource="pen.png" Grid.Column="1" MaximumHeightRequest="32" MaximumWidthRequest="32" Padding="0,0,0,0" Margin="5,0,0,0" BackgroundColor="{StaticResource Gray500}"></Button>
|
||||
</Grid>
|
||||
</ContentView>
|
||||
|
@ -0,0 +1,29 @@
|
||||
namespace Stim;
|
||||
public partial class UserInfo : ContentView
|
||||
{
|
||||
public static readonly BindableProperty BindProperty =
|
||||
BindableProperty.Create(nameof(Bind), typeof(string), typeof(UserInfo), string.Empty, propertyChanged: OnBindChanged);
|
||||
|
||||
public string Bind
|
||||
{
|
||||
get { return (string)GetValue(BindProperty); }
|
||||
set { SetValue(BindProperty, value); }
|
||||
}
|
||||
|
||||
private static void OnBindChanged(BindableObject bindable, object oldValue, object newValue)
|
||||
{
|
||||
var contentView = (UserInfo)bindable;
|
||||
contentView.OnBindChanged((string)oldValue, (string)newValue);
|
||||
}
|
||||
|
||||
public UserInfo()
|
||||
{
|
||||
InitializeComponent();
|
||||
BindingContext = ((App)App.Current).Manager;
|
||||
}
|
||||
|
||||
private void OnBindChanged(string oldValue, string newValue)
|
||||
{
|
||||
// Réagissez aux changements de la propriété de liaison ici
|
||||
}
|
||||
}
|
Loading…
Reference in new issue