mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-04-19 03:27:29 +02:00
Version 3.0.338
This commit is contained in:
parent
573fe77e12
commit
0468955d49
751 changed files with 62747 additions and 60672 deletions
|
@ -7,66 +7,66 @@ using TINK.ViewModel.Info;
|
|||
|
||||
namespace TINK.ViewModel.RootShell
|
||||
{
|
||||
public class AppShellViewModel : INotifyPropertyChanged
|
||||
{
|
||||
public AppShellViewModel()
|
||||
{
|
||||
App.ModelRoot.ActiveUser.StateChanged += (sender, eventargs) =>
|
||||
{
|
||||
// Login state changed. Update related menu entries.
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(IsMyBikesPageVisible)));
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(IsFindBikePageVisible)));
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(IsAccountPageVisible)));
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(IsLoginPageVisible)));
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(IsSettingsPageVisible)));
|
||||
};
|
||||
public class AppShellViewModel : INotifyPropertyChanged
|
||||
{
|
||||
public AppShellViewModel()
|
||||
{
|
||||
App.ModelRoot.ActiveUser.StateChanged += (sender, eventargs) =>
|
||||
{
|
||||
// Login state changed. Update related menu entries.
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(IsMyBikesPageVisible)));
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(IsFindBikePageVisible)));
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(IsAccountPageVisible)));
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(IsLoginPageVisible)));
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(IsSettingsPageVisible)));
|
||||
};
|
||||
|
||||
// Update flyout view model whenever theme is switched.
|
||||
App.ModelRoot.Themes.PropertyChanged += (sender, eventargs) =>
|
||||
{
|
||||
if (!(sender is ServicesContainerMutableT<object> themes))
|
||||
return;
|
||||
// Update flyout view model whenever theme is switched.
|
||||
App.ModelRoot.Themes.PropertyChanged += (sender, eventargs) =>
|
||||
{
|
||||
if (!(sender is ServicesContainerMutableT<object> themes))
|
||||
return;
|
||||
|
||||
MasterDetailMenuTitlte = GetMasterDetailMenuTitle(themes.Active);
|
||||
MasterDetailMenuTitlte = GetMasterDetailMenuTitle(themes.Active);
|
||||
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(MasterDetailMenuTitlte)));
|
||||
};
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(MasterDetailMenuTitlte)));
|
||||
};
|
||||
|
||||
MasterDetailMenuTitlte = GetMasterDetailMenuTitle(App.ModelRoot.Themes.Active);
|
||||
}
|
||||
MasterDetailMenuTitlte = GetMasterDetailMenuTitle(App.ModelRoot.Themes.Active);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the flyout title from theme name
|
||||
/// </summary>
|
||||
/// <param name="theme">Name of theme.</param>
|
||||
/// <returns>Flyout title.</returns>
|
||||
private string GetMasterDetailMenuTitle(object theme)
|
||||
{
|
||||
if (!(theme is ITheme active))
|
||||
return TINK.Themes.ShareeBike.OPERATORINFO;
|
||||
/// <summary>
|
||||
/// Gets the flyout title from theme name
|
||||
/// </summary>
|
||||
/// <param name="theme">Name of theme.</param>
|
||||
/// <returns>Flyout title.</returns>
|
||||
private string GetMasterDetailMenuTitle(object theme)
|
||||
{
|
||||
if (!(theme is ITheme active))
|
||||
return TINK.Themes.ShareeBike.OPERATORINFO;
|
||||
|
||||
return $"{(!string.IsNullOrEmpty(active.OperatorInfo) ? ($"{active.OperatorInfo}") : "sharee.bike")}";
|
||||
}
|
||||
return $"{(!string.IsNullOrEmpty(active.OperatorInfo) ? ($"{active.OperatorInfo}") : "sharee.bike")}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Holds the title of the fylout page.
|
||||
/// </summary>
|
||||
public string MasterDetailMenuTitlte { get; private set; }
|
||||
/// <summary>
|
||||
/// Holds the title of the fylout page.
|
||||
/// </summary>
|
||||
public string MasterDetailMenuTitlte { get; private set; }
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
public bool IsMyBikesPageVisible => App.ModelRoot.ActiveUser.IsLoggedIn;
|
||||
public bool IsMyBikesPageVisible => App.ModelRoot.ActiveUser.IsLoggedIn;
|
||||
|
||||
public bool IsFindBikePageVisible => App.ModelRoot.ActiveUser.IsLoggedIn;
|
||||
public bool IsFindBikePageVisible => App.ModelRoot.ActiveUser.IsLoggedIn;
|
||||
|
||||
public bool IsAccountPageVisible => App.ModelRoot.ActiveUser.IsLoggedIn;
|
||||
public bool IsAccountPageVisible => App.ModelRoot.ActiveUser.IsLoggedIn;
|
||||
|
||||
public bool IsLoginPageVisible => !App.ModelRoot.ActiveUser.IsLoggedIn;
|
||||
public bool IsLoginPageVisible => !App.ModelRoot.ActiveUser.IsLoggedIn;
|
||||
|
||||
public bool IsSettingsPageVisible => App.ModelRoot.Uris.ActiveUri.Host.GetIsCopri()
|
||||
|| App.ModelRoot.ActiveUser.IsLoggedIn;
|
||||
public bool IsSettingsPageVisible => App.ModelRoot.Uris.ActiveUri.Host.GetIsCopri()
|
||||
|| App.ModelRoot.ActiveUser.IsLoggedIn;
|
||||
|
||||
public string TabbedPageIngoTitle => AppResources.MarkingAbout;
|
||||
public string TabbedPageIngoTitle => AppResources.MarkingAbout;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue