Skip to content

Commit

Permalink
Allow binding to Header and ContentTemplate of material:TabItem
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan Kieburg committed May 3, 2024
1 parent eda026f commit ace8f50
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/UraniumUI.Material/Controls/TabItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,17 @@ public class TabItem : UraniumBindableObject

public static readonly BindableProperty TitleProperty = BindableProperty.Create(nameof(Title), typeof(string), typeof(TabItem));

public object Data { get; set; }
public DataTemplate ContentTemplate { get; set; }
public DataTemplate HeaderTemplate { get; set; }
public DataTemplate HeaderTemplate { get => (DataTemplate)GetValue(HeaderTemplateProperty); set => SetValue(HeaderTemplateProperty, value); }

public static readonly BindableProperty HeaderTemplateProperty = BindableProperty.Create(nameof(HeaderTemplate), typeof(DataTemplate), typeof(TabItem), defaultBindingMode: BindingMode.TwoWay);

public DataTemplate ContentTemplate { get => (DataTemplate)GetValue(ContentTemplateProperty); set => SetValue(ContentTemplateProperty, value); }

public static readonly BindableProperty ContentTemplateProperty = BindableProperty.Create(nameof(ContentTemplate), typeof(DataTemplate), typeof(TabItem), defaultBindingMode: BindingMode.TwoWay);

public View Content { get; set; }
public View Header { get; set; }
public object Data { get; set; }
public TabView TabView { get; internal set; }
public bool IsSelected { get => TabView.SelectedTab == this || (TabView.CurrentItem != null && TabView.CurrentItem == Data); }

Expand Down

0 comments on commit ace8f50

Please sign in to comment.