Ejemplo n.º 1
0
        private void InitializeSettings()
        {
            resumeDashboardGrid = new Grid
            {
                Padding           = 0,
                Margin            = 0,
                RowSpacing        = 0,
                VerticalOptions   = LayoutOptions.Start,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                RowDefinitions    =
                {
                    new RowDefinition {
                        Height = GridLength.Auto
                    }
                }
            };

            var stackLayout = new StackLayout
            {
                VerticalOptions   = LayoutOptions.FillAndExpand,
                HorizontalOptions = LayoutOptions.FillAndExpand,
            };

            stackLayout.Children.Add(resumeDashboardGrid);

            var scrollView = ViewElementCustomSetting.GetDefaultScrollView();

            scrollView.Content = stackLayout;

            Content = scrollView;
        }
Ejemplo n.º 2
0
        private void InitializeSettings()
        {
            var listViewDataTemplate = new DataTemplate(() =>
            {
                var nameLabel = new Label
                {
                    FontSize       = Device.GetNamedSize(NamedSize.Large, typeof(Label)),
                    FontAttributes = FontAttributes.Bold,
                    TextColor      = ViewElementCustomSetting.GetColorFromGlobalResource("ListItemPrimaryStyle")
                };
                nameLabel.SetBinding(Label.TextProperty, new Binding("Name", BindingMode.OneWay));

                var notesLabel = new Label
                {
                    FontSize  = Device.GetNamedSize(NamedSize.Medium, typeof(Label)),
                    TextColor = ViewElementCustomSetting.GetColorFromGlobalResource("ListItemSecondaryStyle")
                };
                notesLabel.SetBinding(Label.TextProperty, new Binding("Notes", BindingMode.OneWay));

                var minimumFixedHeightSize = nameLabel.FontSize + notesLabel.FontSize + 2;
                var stackLayout            = new StackLayout
                {
                    Padding              = 0,
                    Margin               = 0,
                    VerticalOptions      = LayoutOptions.FillAndExpand,
                    MinimumHeightRequest = minimumFixedHeightSize,
                    Children             =
                    {
                        nameLabel,
                        notesLabel
                    }
                };

                var commandForAnimation = new Command <View>(view =>
                {
                    view.DoScaleAnimation();
                });
                stackLayout.GestureRecognizers.Add(new TapGestureRecognizer {
                    Command = commandForAnimation, CommandParameter = stackLayout
                });

                var commandForEditAction = new Command <Contact>(async e =>
                {
                    await ItemTappedForEdition_ClickedAsync(this, e);
                });
                var tapGestureForEditAction = new TapGestureRecognizer {
                    Command = commandForEditAction
                };
                tapGestureForEditAction.SetBinding(TapGestureRecognizer.CommandParameterProperty, new Binding(".", BindingMode.OneWay));
                stackLayout.GestureRecognizers.Add(tapGestureForEditAction);

                return(new ViewCell {
                    View = stackLayout
                });
            });

            ItemListView.ItemTemplate  = listViewDataTemplate;
            ItemListView.HasUnevenRows = true;
        }
Ejemplo n.º 3
0
        private void RegisterAppInformationPanel()
        {
            var appAssemblyInformationLabel = new Label {
                FormattedText = new FormattedString(), FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label))
            };

            appAssemblyInformationLabel.FormattedText.Spans.Add(new Span {
                Text = Strings.AppName, FontAttributes = FontAttributes.Bold
            });
            appAssemblyInformationLabel.FormattedText.Spans.Add(new Span {
                Text = "   "
            });
#if DEBUG
            appAssemblyInformationLabel.FormattedText.Spans.Add(new Span {
                Text = $"{PmdAppSetting.Version} [DEBUG]", ForegroundColor = ViewElementCustomSetting.GetColorFromGlobalResource("LightTextColor")
            });
#else
            appAssemblyInformationLabel.FormattedText.Spans.Add(new Span {
                Text = PmdAppSetting.Version, ForegroundColor = ViewElementCustomSetting.GetColorFromGlobalResource("LightTextColor")
            });
#endif
            ContentDescription.Children.Add(appAssemblyInformationLabel);

            var developerInformationLabel = new Label {
                FormattedText = new FormattedString()
            };
            developerInformationLabel.FormattedText.Spans.Add(new Span {
                Text = Strings.Label_DevelopedBy
            });
            developerInformationLabel.FormattedText.Spans.Add(new Span {
                Text = " "
            });
            developerInformationLabel.FormattedText.Spans.Add(new Span {
                Text = Strings.AppAuthor, FontAttributes = FontAttributes.Bold
            });
            developerInformationLabel.FormattedText.Spans.Add(new Span {
                Text = " | "
            });
            developerInformationLabel.FormattedText.Spans.Add(new Span {
                Text = "Icons by Icons8"
            });
            developerInformationLabel.GestureRecognizers.Add(new TapGestureRecognizer {
                Command = new Command(() => Device.OpenUri(new Uri("http://corderoski.com")))
            });
            ContentDescription.Children.Add(developerInformationLabel);
        }
Ejemplo n.º 4
0
        private void InitializeSettings()
        {
            var addButton = new Button
            {
                Text = ViewModelConstants.CHECKPOINT_SYMBOL,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                WidthRequest      = Width
            };

            addButton.SetPrimaryButtonStyle();

            var addToolBarItem = new ToolbarItem {
                Icon = Device.OnPlatform(null, "check_bar.png", null)
            };

            addButton.Clicked      += AddItemSaveAction_Clicked;
            addToolBarItem.Clicked += AddItemSaveAction_Clicked;
            this.ToolbarItems.Add(addToolBarItem);

            nameEntryControl = new Entry {
                Keyboard = Keyboard.Text
            };
            var sLayout = new StackLayout
            {
                Padding  = ViewElementCustomSetting.GetStandardThickness(),
                Spacing  = 10,
                Children =
                {
                    new Label {
                        Text = Strings.Label_Name
                    },
                    nameEntryControl,

                    addButton
                }
            };

            Content = sLayout;

            if (_pageModeType == ManagementPageModeType.Edit)
            {
                nameEntryControl.Text = _editingEntity.Name;
            }
        }
Ejemplo n.º 5
0
        private void RegisterUserSigninPanel()
        {
            var userSigninInformationLabel = new Label
            {
                FormattedText = new FormattedString(),
                FontSize      = Device.GetNamedSize(NamedSize.Medium, typeof(Label))
            };

            userSigninInformationLabel.FormattedText.Spans.Add(new Span {
                Text = Strings.Message_About_SinginInfoLabel_First
            });
            userSigninInformationLabel.FormattedText.Spans.Add(new Span
            {
                Text           = string.Join(", ", AuthenticationHelper.Providers),
                FontAttributes = FontAttributes.Bold
            });
            userSigninInformationLabel.FormattedText.Spans.Add(new Span {
                Text = Strings.Message_About_SinginInfoLabel_Second
            });
            SecuredStackLayout.Children.Add(userSigninInformationLabel);

            var loginButton = ViewElementCustomSetting.GetDefaultPrimaryButton(text: Strings.Label_SignIn);

            loginButton.Command = _viewModel.DoLoginCommand;
            loginButton.SetBinding(IsVisibleProperty, "IsAuthenticationPending", mode: BindingMode.OneWay);
            SecuredStackLayout.Children.Add(loginButton);

            var signoutButton = ViewElementCustomSetting.GetDefaultPrimaryButton(
                text: Strings.Label_SignOut, color: ViewElementCustomSetting.GetColorFromGlobalResource("DangerRedColor"));

            signoutButton.SetBinding(IsVisibleProperty, new Binding("IsAuthenticationPending", BindingMode.Default,
                                                                    new BooleanInverseValueConverter(), null));
            signoutButton.Clicked += async(sender, args) =>
            {
                var result = await DisplayAlert(Strings.Label_Warning_Title, Strings.Message_Profile_WarningEraseProfileData,
                                                Strings.Label_GotIt, Strings.Label_No);

                if (result)
                {
                    _viewModel.ExecuteUserLogout();
                }
            };
            SecuredStackLayout.Children.Add(signoutButton);
        }
Ejemplo n.º 6
0
        private void InitializeSettings()
        {
            var listViewDataTemplate = new DataTemplate(() =>
            {
                var dataLabel = new Label
                {
                    FontSize  = Device.GetNamedSize(NamedSize.Medium, typeof(Label)),
                    TextColor = ViewElementCustomSetting.GetColorFromGlobalResource("ListItemPrimaryStyle")
                };
                dataLabel.SetBinding(Label.TextProperty, new Binding("Name", BindingMode.OneWay));

                var stackLayout = new StackLayout()
                {
                    Padding = new Thickness(8), Children = { dataLabel }
                };

                var commandForAnimation = new Command <View>(view =>
                {
                    view.DoScaleAnimation();
                });
                stackLayout.GestureRecognizers.Add(new TapGestureRecognizer {
                    Command = commandForAnimation, CommandParameter = stackLayout
                });

                var commandForEditAction = new Command <Tag>(async tag =>
                {
                    await ItemTappedForEdition_ClickedAsync(this, tag);
                });
                var tapGestureForEditAction = new TapGestureRecognizer {
                    Command = commandForEditAction
                };
                tapGestureForEditAction.SetBinding(TapGestureRecognizer.CommandParameterProperty, new Binding(".", BindingMode.OneWay));
                stackLayout.GestureRecognizers.Add(tapGestureForEditAction);

                return(new ViewCell {
                    View = stackLayout
                });
            });

            ItemListView.ItemTemplate = listViewDataTemplate;
            ItemListView.RowHeight    = Device.OnPlatform(50, 50, 60);
        }
Ejemplo n.º 7
0
        public ViewManagementPage()
        {
            DataStore = PayMeDataStore.DefaultDataStore;

            SyncIndicator = ViewElementCustomSetting.GetDefaultActivityIndicator();
            ItemListView  = new ListView
            {
                IsPullToRefreshEnabled = true
            };

            ItemListView.Refreshing += OnRefresh;
            ItemListView.ItemsSource = Items;

            MainBaseLayout = new StackLayout {
                Padding           = Helpers.ViewElementCustomSetting.GetStandardThickness(),
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions   = LayoutOptions.FillAndExpand,
                Children          =
                {
                    SyncIndicator,
                    ItemListView
                }
            };
            Content = MainBaseLayout;

            var newEntityToolbarItem = new ToolbarItem
            {
                Icon = Device.OnPlatform(null, "add.png", null)
            };

            newEntityToolbarItem.Clicked += async(sender, args) =>
            {
                await ToolbarItemNewEntity_ClickedAsync(sender, args);
            };

            ToolbarItems.Add(newEntityToolbarItem);
        }
Ejemplo n.º 8
0
        private void InitializeSettings()
        {
            var addButton = new Button
            {
                Text = ViewModelConstants.CHECKPOINT_SYMBOL,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                WidthRequest      = Width
            };

            addButton.SetPrimaryButtonStyle();

            var addToolBarItem = new ToolbarItem {
                Icon = Device.OnPlatform(null, "check_bar.png", null)
            };

            addButton.Clicked      += AddToolBarItemSave_Clicked;
            addToolBarItem.Clicked += AddToolBarItemSave_Clicked;
            ToolbarItems.Add(addToolBarItem);

            nameEntryControl = new Entry {
                Keyboard = Keyboard.Text
            };
            notesEntryControl = new Editor {
                Keyboard = Keyboard.Default, HeightRequest = ViewElementCustomSetting.GetStandardEditorSize()
            };
            var sLayout = new StackLayout
            {
                Padding  = ViewElementCustomSetting.GetStandardThickness(),
                Spacing  = 10,
                Children =
                {
                    new Label {
                        Text = Strings.Label_Name
                    },
                    nameEntryControl,
                    new Label {
                        Text = Strings.Label_Notes
                    },
                    notesEntryControl,

                    addButton
                }
            };

            Content = sLayout;

            if (_pageModeType == ManagementPageModeType.Edit)
            {
                nameEntryControl.Text  = _editingEntity.Name;
                notesEntryControl.Text = _editingEntity.Notes;

                var removeToolBarItem = new ToolbarItem {
                    Icon = Device.OnPlatform(null, "clear.png", null)
                };
                removeToolBarItem.Clicked += (sender, args) =>
                {
                    MessagingCenter.Send(this, ViewModelConstants.REMOVE_ITEM_SUBSCRIPTION, _editingEntity);
                };
                ToolbarItems.Insert(0, removeToolBarItem);
            }
        }
        private void InitializeSettings()
        {
            var addButton = new Button
            {
                Text = ViewModelConstants.CHECKPOINT_SYMBOL,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                WidthRequest      = Width
            };

            addButton.SetPrimaryButtonStyle();

            var addToolBarItem = new ToolbarItem {
                Icon = Device.OnPlatform(null, "check_bar.png", null)
            };

            addButton.Clicked      += AddToolBarItemSave_Clicked;
            addToolBarItem.Clicked += AddToolBarItemSave_Clicked;
            this.ToolbarItems.Add(addToolBarItem);

            // amount input
            amountEntryControl = new Entry
            {
                Keyboard    = Keyboard.Numeric,
                Placeholder = ViewModelConstants.INPUT_CURRENCY_PLACEHOLDER
            };
            // description input
            descriptionEntryControl = new Editor
            {
                Keyboard      = Keyboard.Text,
                HeightRequest = ViewElementCustomSetting.GetStandardEditorSize()
            };
            // contacts picker
            contactPicker = new Picker
            {
                Title     = Strings.Label_Contacts,
                IsVisible = true,
                TextColor = ViewElementCustomSetting.GetColorFromGlobalResource("ListItemSecondaryStyle")
            };
            contactPicker.ItemDisplayBinding    = new Binding("Name");
            contactPicker.SelectedIndexChanged += Picker_SelectedIndexChanged;

            var sLayout = new StackLayout
            {
                Padding  = new Thickness(0, 0, 0, 0),
                Spacing  = 10,
                Children =
                {
                    new Label {
                        Text = ViewModelConstants.INPUT_CURRENCY_SYMBOL
                    },
                    amountEntryControl,

                    new Label {
                        Text = Strings.Label_Description
                    },
                    descriptionEntryControl,

                    new Label {
                        Text = Strings.Label_Contact
                    },
                    contactPicker,

                    addButton
                }
            };

            Content = sLayout;
        }