protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.AddComment); // Retrieve navigation parameter and set as current "DataContext" Vm = GlobalNavigation.GetAndRemoveParameter <FlowerViewModel>(Intent); // Avoid aggressive linker problem which removes the TextChanged event CommentText.TextChanged += (s, e) => { }; _saveBinding = this.SetBinding( () => CommentText.Text); // Avoid aggressive linker problem which removes the Click event SaveCommentButton.Click += (s, e) => { }; SaveCommentButton.SetCommand( "Click", Vm.SaveCommentCommand, _saveBinding); }
public vmMenu() { GlobalNavigation.Reiniciar(); ns = GlobalNavigation.NavService; GlobalNavigation.Modulo = "DESENVOLVIMENTO"; GetAcesso(); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.Details); // Retrieve navigation parameter and set as current "DataContext" Vm = GlobalNavigation.GetAndRemoveParameter <FlowerViewModel>(Intent); var headerView = LayoutInflater.Inflate(Resource.Layout.CommentsListHeaderView, null); headerView.FindViewById <TextView>(Resource.Id.NameText).Text = Vm.Model.Name; headerView.FindViewById <TextView>(Resource.Id.DescriptionText).Text = Vm.Model.Description; CommentsList.AddHeaderView(headerView); CommentsList.Adapter = Vm.Model.Comments.GetAdapter(GetCommentTemplate); ImageDownloader.AssignImageAsync(FlowerImageView, Vm.Model.Image, this); AddCommentButton.SetCommand(Vm.AddCommentCommand); // Subscribing to events to avoid linker issues in release mode --------------------------------- // This "fools" the linker into believing that the events are used. // In fact we don't even subscribe to them. // See https://developer.xamarin.com/guides/android/advanced_topics/linking/ if (_falseFlag) { AddCommentButton.Click += (s, e) => { }; } }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.Details); // Retrieve navigation parameter and set as current "DataContext" Vm = GlobalNavigation.GetAndRemoveParameter <FlowerViewModel>(Intent); var headerView = LayoutInflater.Inflate(Resource.Layout.CommentsListHeaderView, null); headerView.FindViewById <TextView>(Resource.Id.NameText).Text = Vm.Model.Name; headerView.FindViewById <TextView>(Resource.Id.DescriptionText).Text = Vm.Model.Description; CommentsList.AddHeaderView(headerView); CommentsList.Adapter = Vm.Model.Comments.GetAdapter(GetCommentTemplate); ImageDownloader.AssignImageAsync(FlowerImageView, Vm.Model.Image, this); // Avoid aggressive linker problem which removes the Click event AddCommentButton.Click += (s, e) => { }; AddCommentButton.SetCommand( "Click", Vm.AddCommentCommand); }
public vmMainContent() { GlobalNavigation.Reiniciar(); ns = GlobalNavigation.NavService; GlobalNavigation.Modulo = "GOVERNO"; GetAcesso(); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.AddComment); // Retrieve navigation parameter and set as current "DataContext" Vm = GlobalNavigation.GetAndRemoveParameter <FlowerViewModel>(Intent); _saveBinding = this.SetBinding(() => CommentText.Text); SaveCommentButton.SetCommand( Vm.SaveCommentCommand, _saveBinding); // Subscribing to events to avoid linker issues in release mode --------------------------------- // This "fools" the linker into believing that the events are used. // In fact we don't even subscribe to them. // See https://developer.xamarin.com/guides/android/advanced_topics/linking/ if (_falseFlag) { SaveCommentButton.Click += (s, e) => { }; CommentText.TextChanged += (s, e) => { }; } }
public vmModulos() { GlobalNavigation.Reiniciar(); ns = GlobalNavigation.NavService; ns.RemoveBackEntry(); HasUpdate = false; GetAcesso(); }
/// <summary> /// Inicio /// </summary> public vmSelectModules() { GlobalNavigation.Reiniciar(); ns = GlobalNavigation.NavService; ns.RemoveBackEntry(); Task.Factory.StartNew(() => CreatButtons()).ContinueWith(task => { if (task.IsCompleted) { ButtonsModules = task.Result; //SysModules = task.Result; } }); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.AddComment); // Retrieve navigation parameter and set as current "DataContext" Vm = GlobalNavigation.GetAndRemoveParameter <FlowerViewModel>(Intent); _saveBinding = this.SetBinding( () => CommentText.Text); SaveCommentButton.SetCommand( "Click", Vm.SaveCommentCommand, _saveBinding); }
/// <summary> /// Observa Propriedades Globais /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnGlobalPropertyChanged(object sender, PropertyChangedEventArgs e) { if (e.PropertyName == "Autenticado") { if (Logged.Autenticado == false) { GlobalNavigation.Reiniciar(); MenuOn = Visibility.Collapsed; IsAdmin = Visibility.Collapsed; MenuOnOff = Visibility.Collapsed; //Application.Current.Resources["WindowBackgroundColor"] = Color.FromRgb(0x1b, 0xa1, 0xe2); if (mStarted.SimStarted) { ns.Navigate(new Uri(Properties.Resources.Sim_View_Load, UriKind.Relative)); } else { ns.Navigate(new Uri(Account.Properties.Resources.Account_Login_User, UriKind.Relative)); WindowChomeButtonsVisible = Visibility.Visible; StartClosed = Visibility.Collapsed; } Color paleta = new Color(); //paleta = (Color)ColorConverter.ConvertFromString("##00FFFF"); paleta = Color.FromRgb(0x1b, 0xa1, 0xe2); new UI.Presentation.ThemeManager().ApplyTheme(paleta, "Light"); } else { Color paleta = new Color(); paleta = (Color)ColorConverter.ConvertFromString(Logged.Color); new UI.Presentation.ThemeManager().ApplyTheme(paleta, Logged.Thema); MenuOn = Visibility.Visible; Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Background, new System.Action(delegate { ns.Navigate(new Uri(Properties.Resources.Sim_View_Root, UriKind.Relative)); })); if (Logged.Acesso >= (int)AccountAccess.Administrador) { IsAdmin = Visibility.Visible; } } if (Logged.Sexo == "F") { IconUser = UserIcon.Woman; } if (Logged.Sexo == "M") { IconUser = UserIcon.Man; } Operador = Logged.Nome; } if (e.PropertyName == "Modulo") { Modulo = GlobalNavigation.Modulo; } if (e.PropertyName == "UriModulo") { UriModulo = GlobalNavigation.UriModulo; } if (e.PropertyName == "UriSubModulo") { UriSubModulo = GlobalNavigation.UriSubModulo; } if (e.PropertyName == "SubModulo") { SubModulo = GlobalNavigation.SubModulo; } if (e.PropertyName == "Pagina") { Pagina = GlobalNavigation.Pagina; } if (e.PropertyName == "BrowseBack") { BrowseBack = GlobalNavigation.BrowseBack; } }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); DataContext = GlobalNavigation.GetAndRemoveParameter(NavigationContext); }
/// <summary> /// Observa Propriedades Globais /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnGlobalPropertyChanged(object sender, PropertyChangedEventArgs e) { if (e.PropertyName == "Autenticado") { if (AccountOn.Autenticado == false) { GlobalNavigation.Reiniciar(); MenuOn = Visibility.Collapsed; IsAdmin = Visibility.Collapsed; MenuOnOff = Visibility.Collapsed; vW = 20; ns.Navigate(new Uri("/Sim.Modulo.Autenticacao;component/View/vLogin.xaml", UriKind.Relative)); Color paleta = new Color(); //paleta = (Color)ColorConverter.ConvertFromString("##00FFFF"); paleta = Color.FromRgb(0x1b, 0xa1, 0xe2); new ModernUI.Presentation.ThemeManager().Apply(paleta, "Light"); } else { Color paleta = new Color(); paleta = (Color)ColorConverter.ConvertFromString(AccountOn.Color); new ModernUI.Presentation.ThemeManager().Apply(paleta, AccountOn.Thema); MenuOn = Visibility.Visible; ns.Navigate(new Uri("/Sim.App.Desktop;component/View/pModulos.xaml", UriKind.Relative)); if (AccountOn.Acesso >= (int)AccountAccess.Administrador) { IsAdmin = Visibility.Visible; } } if (AccountOn.Sexo == "F") { IconUser = mIcons.IcoWom; } if (AccountOn.Sexo == "M") { IconUser = mIcons.IcoMan; } Operador = AccountOn.Nome; } if (e.PropertyName == "Modulo") { Modulo = GlobalNavigation.Modulo; } if (e.PropertyName == "UriModulo") { UriModulo = GlobalNavigation.UriModulo; } if (e.PropertyName == "UriSubModulo") { UriSubModulo = GlobalNavigation.UriSubModulo; } if (e.PropertyName == "SubModulo") { SubModulo = GlobalNavigation.SubModulo; } if (e.PropertyName == "Pagina") { Pagina = GlobalNavigation.Pagina; } if (e.PropertyName == "BrowseBack") { BrowseBack = GlobalNavigation.BrowseBack; } }