Example #1
0
        void LoadRoomList()
        {
            SettingsModel settingsModel = SettingsModel.GetInstance();
            List <string> rooms         = settingsModel.Rooms;

            if (rooms.Count > 0)
            {
                foreach (string room in rooms)
                {
                    RelativePanel relativePanel = new RelativePanel();
                    relativePanel.Width = 100;
                    TextBlock roomText = new TextBlock();
                    roomText.Name = "rt" + rooms.IndexOf(room);
                    roomText.Text = room;
                    Button deleteButton = new Button();
                    RelativePanel.SetAlignRightWithPanel(deleteButton, true);
                    RelativePanel.SetAlignVerticalCenterWith(deleteButton, roomText.Name);
                    TextBlock deleteText = new TextBlock();
                    deleteText.Text       = "\u2573";
                    deleteText.FontFamily = new FontFamily("Segoe UI Symbol");
                    deleteText.FontSize   = 12;
                    deleteText.Height     = 20;

                    deleteButton.Name   = "db" + rooms.IndexOf(room);
                    deleteButton.Click += new RoutedEventHandler(DeleteButton_Click);

                    deleteButton.Content = deleteText;
                    relativePanel.Children.Add(roomText);
                    relativePanel.Children.Add(deleteButton);
                    roomList.Items.Add(relativePanel);
                }
            }
        }
Example #2
0
        /// <summary>
        /// Builds a relative panel containing the details of a voice memo
        /// </summary>
        /// <param name="voiceMemo">The voice memo to build the panel for</param>
        /// <param name="audioRecorder">The object that will play the voice memo's audio</param>
        /// <param name="DeleteCallBack">the callback function for when the voice memo's delete button is clicked</param>
        /// <returns></returns>
        public static RelativePanel BuildVoiceMemoPanel(VoiceMemo voiceMemo, AudioRecorder audioRecorder, Action DeleteCallBack = null)
        {
            var panel = new RelativePanel();

            panel.Margin = new Thickness(0, 10, 0, 10);
            var ellipse           = BuildMemoEllipse();
            var titleBlock        = BuildTitleBlock(voiceMemo);
            var durationBlock     = BuildDurationBlock(voiceMemo);
            var dateRecordedBlock = BuildDateRecordedBlock(voiceMemo);
            var deleteButton      = BuildDeleteButton(voiceMemo, audioRecorder, DeleteCallBack);
            var playbackButton    = BuildPlayBackButton(voiceMemo, audioRecorder);

            panel.Children.Add(ellipse);
            panel.Children.Add(titleBlock);
            panel.Children.Add(durationBlock);
            panel.Children.Add(dateRecordedBlock);
            panel.Children.Add(deleteButton);
            panel.Children.Add(playbackButton);
            // position the elements within the panel
            RelativePanel.SetRightOf(titleBlock, ellipse);
            RelativePanel.SetAlignVerticalCenterWith(titleBlock, ellipse);
            RelativePanel.SetBelow(durationBlock, titleBlock);
            RelativePanel.SetAlignLeftWith(durationBlock, titleBlock);
            RelativePanel.SetBelow(dateRecordedBlock, durationBlock);
            RelativePanel.SetAlignLeftWith(dateRecordedBlock, durationBlock);
            RelativePanel.SetBelow(deleteButton, dateRecordedBlock);
            RelativePanel.SetAlignBottomWithPanel(deleteButton, true);
            RelativePanel.SetAlignLeftWithPanel(deleteButton, true);
            RelativePanel.SetBelow(playbackButton, dateRecordedBlock);
            RelativePanel.SetAlignBottomWithPanel(playbackButton, true);
            RelativePanel.SetAlignRightWithPanel(playbackButton, true);
            return(panel);
        }
Example #3
0
        private void UcRatingText_VisibleBoundsChanged(Windows.UI.ViewManagement.ApplicationView sender, object args)
        {
            var Width = Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().VisibleBounds.Width;

            if (Width >= 360)
            {
                RelativePanel.SetBelow(tbTexto, null);
                RelativePanel.SetRightOf(tbTexto, rcStars);
                RelativePanel.SetAlignVerticalCenterWith(tbTexto, rcStars);
                RelativePanel.SetAlignVerticalCenterWithPanel(rcStars, true);
            }
            else
            {
                RelativePanel.SetRightOf(tbTexto, null);
                RelativePanel.SetBelow(tbTexto, rcStars);
                RelativePanel.SetAlignVerticalCenterWith(tbTexto, null);
                RelativePanel.SetAlignVerticalCenterWithPanel(rcStars, false);
            }
        }
        private void MyUserControl1_VisibleBoundsChanged(Windows.UI.ViewManagement.ApplicationView sender, object args)
        {
            var width = Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().VisibleBounds.Width;

            if (width >= 360)
            {
                RelativePanel.SetBelow(FavText, null);
                RelativePanel.SetRightOf(FavText, Stars);

                RelativePanel.SetAlignVerticalCenterWith(FavText, Stars);
                RelativePanel.SetAlignVerticalCenterWithPanel(Stars, true);
            }
            else
            {
                RelativePanel.SetBelow(FavText, null);
                RelativePanel.SetRightOf(FavText, Stars);

                RelativePanel.SetAlignVerticalCenterWith(FavText, null);
                RelativePanel.SetAlignVerticalCenterWithPanel(Stars, false);
            }
        }
        private void FavorityUC_VisibleBoundsChanged(ApplicationView sender, object args)
        {
            var width = ApplicationView.GetForCurrentView().VisibleBounds.Width;

            if (width >= 360)
            {
                //VisualStateManager.GoToState(this, "Width360", false);
                RelativePanel.SetBelow(FavText, null);
                RelativePanel.SetRightOf(FavText, Stars);
                RelativePanel.SetAlignVerticalCenterWith(FavText, Stars);
            }
            else
            {
                //VisualStateManager.GoToState(this, "Width0", false);
                RelativePanel.SetRightOf(FavText, null);
                RelativePanel.SetBelow(FavText, Stars);

                RelativePanel.SetAlignVerticalCenterWith(FavText, null);
                RelativePanel.SetAlignVerticalCenterWithPanel(Stars, false);
            }
        }