/// <summary>
        /// Custom view constructor
        /// </summary>
        public SegmentCustomView()
        {
            InitializeComponent();
            timeLabel.Text = DateTime.Now.ToString("MMM dd, h:mm:ss tt");
            var reactionView = new ReactionView();

            CustomSegmentsContainer.ItemsSource = new ObservableCollection <View>
            {
                likeButton,
                loveButton,
                laughButton,
                wowButton,
                sadButton,
                angryButton
            };
            buttonContainer.ItemsSource = new ObservableCollection <View>
            {
                likeViewButton,
                shareViewButton
            };
            if (Device.Idiom == TargetIdiom.Desktop)
            {
                MainGrid.VerticalOptions          = LayoutOptions.Center;
                MainGrid.HorizontalOptions        = LayoutOptions.Center;
                MainGrid.WidthRequest             = 500;
                MainGrid.RowDefinitions[0].Height = 100;
                MainGrid.RowDefinitions[1].Height = 300;
                MainGrid.RowDefinitions[2].Height = 50;
                MainGrid.RowDefinitions[3].Height = 100;
                MainScrollView.HorizontalOptions  = LayoutOptions.Center;
            }
            if (Device.RuntimePlatform == Device.UWP)
            {
                CustomSegmentsContainer.BackgroundColor = Color.White;
                name.Margin      = new Thickness(10, 0, 0, 0);
                timeLabel.Margin = new Thickness(10, -5, 0, 0);
            }
            else if (Device.RuntimePlatform == Device.Android)
            {
                CustomSegmentsContainer.BackgroundColor = Color.White;
            }
            else if (Device.RuntimePlatform == Device.iOS)
            {
                CustomSegmentsContainer.BackgroundColor = Color.Transparent;
            }
            likeViewButton.Clicked += (sender, args) =>
            {
                if (this.frame.Opacity == 0)
                {
                    likeViewButton.BorderColor = Color.FromHex("#007DE6");
                    likeViewButton.TextColor   = Color.FromHex("#007DE6");
                    this.frame.FadeTo(1, 1000, Easing.Linear);
                }
                else
                {
                    this.CollapseSmileys();
                }
            };
            shareViewButton.Clicked += ShareViewButtonOnClicked;
        }
Ejemplo n.º 2
0
 private void AnalogousUC_WorkingAreaTabChanged(object sender, int e)
 {
     if (e == 1)
     {
         ReactionView.ScrollIntoView(ReactionView.SelectedItem);
     }
 }
Ejemplo n.º 3
0
        private void ListView_Selected(object sender, SelectionChangedEventArgs e)
        {
            ReactionView.ScrollIntoView(ReactionView.SelectedItem);
            var mainVM = (App.Current.MainWindow as MainWindow).DataContext as MainVM;

            if (mainVM != null && mainVM.TanVM != null && ReactionView.SelectedItem != null)
            {
                mainVM.TanVM.SelectedReaction = mainVM.TanVM.Reactions.Where(r => r.Id == (ReactionView.SelectedItem as ReactionViewVM).ReactionId).FirstOrDefault();
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Custom view constructor
        /// </summary>
        public SegmentCustomView()
        {
            InitializeComponent();
            timeLabel.Text = DateTime.Now.ToString("MMM dd, h:mm:ss tt");
            var reactionView = new ReactionView();

            CustomSegmentsContainer.ItemsSource = new ObservableCollection <View>
            {
                likeButton,
                loveButton,
                laughButton,
                wowButton,
                sadButton,
                angryButton
            };
            buttonContainer.ItemsSource = new ObservableCollection <View>
            {
                likeViewButton,
                shareViewButton
            };
            if (Device.RuntimePlatform == Device.UWP)
            {
                CustomSegmentsContainer.BackgroundColor = Color.White;
            }
            else if (Device.RuntimePlatform == Device.Android)
            {
                CustomSegmentsContainer.BackgroundColor = Color.White;
            }
            else if (Device.RuntimePlatform == Device.iOS)
            {
                CustomSegmentsContainer.BackgroundColor = Color.Transparent;
            }
            likeViewButton.Clicked += (sender, args) =>
            {
                if (this.frame.Opacity == 0)
                {
                    likeViewButton.BorderColor = Color.FromHex("#007DE6");
                    likeViewButton.TextColor   = Color.FromHex("#007DE6");
                    this.frame.FadeTo(1, 1000, Easing.Linear);
                }
                else
                {
                    this.CollapseSmileys();
                }
            };
            shareViewButton.Clicked += ShareViewButtonOnClicked;
        }