This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Shell.FlyoutHeaderTemplate> | |
<DataTemplate> | |
<yummy:PancakeView | |
BackgroundGradientAngle="0" | |
BackgroundGradientEndColor="{StaticResource flyoutGradientEndFaded}" | |
BackgroundGradientStartColor="{StaticResource flyoutGradientStartFaded}" | |
HorizontalOptions="FillAndExpand" | |
IsClippedToBounds="true" | |
VerticalOptions="FillAndExpand"> | |
<StackLayout Margin="0,10,0,0" Padding="25"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<FlyoutItem | |
Title="Item Search" | |
FlyoutDisplayOptions="AsSingleItem" | |
Route="Items_Search"> | |
<Tab Title="Item Search" Route="item_search"> | |
<ShellContent | |
Title="Item Search" | |
ContentTemplate="{DataTemplate local:ItemSearchPage}" | |
Route="item_search" /> | |
</Tab> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<FlyoutItem | |
Title="Items" | |
FlyoutDisplayOptions="AsSingleItem" | |
Route="Header_Items" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected override DataTemplate OnSelectTemplate(object item, BindableObject container) | |
{ | |
// Returning something like this will look at the route declaration and determine if it's a header or item | |
return ((FlyoutItem)item).Route.StartsWith("Header") ? NavigationHeaderTemplate : NavigationItemTemplate; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Shell | |
... | |
ItemTemplate="{StaticResource FlyoutTemplateSelector}" | |
... > |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Style x:Key="FlyoutHeaderStyle" TargetType="Label"> | |
<Setter Property="FontSize" Value="Default" /> | |
<Setter Property="Margin" Value="15,0" /> | |
<Setter Property="TextColor" Value="Black" /> | |
<Setter Property="FontAttributes" Value="Bold" /> | |
<Setter Property="HorizontalOptions" Value="Start" /> | |
</Style> | |
<Style x:Key="FlyoutItemStyle" TargetType="Label"> | |
<Setter Property="FontSize" Value="Default" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class NavigationFlyoutItemTemplateSelector : DataTemplateSelector | |
{ | |
public DataTemplate NavigationHeaderTemplate { get; set; } | |
public DataTemplate NavigationItemTemplate { get; set; } | |
protected override DataTemplate OnSelectTemplate(object item, BindableObject container) | |
{ | |
//Returning null, because at this point I'm not sure how to select the correct template | |
return null; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Shell.ItemTemplate> | |
<DataTemplate> | |
<ContentView> | |
Bindable Properties: Title, Icon | |
</ContentView> | |
</DataTemplate> | |
</Shell.ItemTemplate> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//I actually have this separated out into a model class, but it could technically be internal like this | |
internal class NavigationItem { | |
public string Title { get; set; } ////This pairs with ShellItem.Title | |
public DataTemplate Template { get; set; } ////This pairs with ShellItem.ContentTemplate | |
public ImageSource Image { get; set; } ////This pairs with ShellItem.Icon | |
public string Route { get; set; } ////This pairs with ShellItem.Route | |
public List<ShellContent> Tabs { get; set; } ////This pairs with ShellItem.Tab | |
public bool HasImage => Image != null; ////These are optional, and just for validation purpose | |
public bool HasNavigation => Template != null; ////These are optional, and just for validation purpose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (mCurrentBookUri == null) { | |
Toast.makeText(this,getString(R.string.not_save_msg), Toast.LENGTH_SHORT).show(); | |
} | |
if (TextUtils.isEmpty(nameString)){ | |
Toast.makeText(this, getString(R.string.enter_name_req),Toast.LENGTH_SHORT).show(); | |
return; | |
} | |
if (TextUtils.isEmpty(priceString)){ | |
Toast.makeText(this, getString(R.string.enter_price_req),Toast.LENGTH_SHORT).show(); | |
return; |
NewerOlder