Skip to content

Commit

Permalink
Merge pull request #662 from StepKie/tabItem-templateBindings
Browse files Browse the repository at this point in the history
Allow binding to HeaderTemplate and ContentTemplate of material:TabItem
  • Loading branch information
enisn authored May 7, 2024
2 parents eda026f + ace8f50 commit d32fc82
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 d32fc82

Please sign in to comment.