Пример #1
0
        private void TextBlock_MouseUp(object sender, MouseButtonEventArgs e)
        {
            TextBlock         tb = (TextBlock)sender;
            PanelPartEmbedded pp = (PanelPartEmbedded)tb.DataContext;

            DashboardClient.PartViews.GetOrThrow(pp.Content.GetType()).OnTitleClick(pp.Content);
        }
Пример #2
0
        private void fullScreen_Click(object sender, RoutedEventArgs e)
        {
            Button            tb = (Button)sender;
            PanelPartEmbedded pp = (PanelPartEmbedded)tb.DataContext;

            DashboardClient.PartViews.GetOrThrow(pp.Content.GetType()).FullScreen(tb, pp.Content);
        }
Пример #3
0
        public ActionResult AddNewPart(string rootType, string propertyRoute, string newPartType, string partialViewName)
        {
            var type = Navigator.ResolveType(newPartType);

            PanelPartEmbedded part = new PanelPartEmbedded
            {
                StartColumn = 0,
                Columns     = 12,
                Content     = (IPartEntity)Activator.CreateInstance(type),
            };

            PropertyRoute route = PropertyRoute.Parse(TypeLogic.GetType(rootType), propertyRoute);

            ViewData[GridRepeaterHelper.LastEnd] = 0;
            return(Navigator.PartialView(this, new TypeContext <PanelPartEmbedded>(part, null, this.Prefix(), route), partialViewName));
        }
Пример #4
0
        private void GroupBox_Loaded(object sender, RoutedEventArgs e)
        {
            GroupBox          gb = (GroupBox)sender;
            PanelPartEmbedded pp = (PanelPartEmbedded)gb.DataContext;
            PartView          pv = DashboardClient.PartViews.GetOrThrow(pp.Content.GetType());

            if (pv.OnTitleClick != null && (pv.IsTitleEnabled == null || pv.IsTitleEnabled()))
            {
                TextBlock tb = (TextBlock)gb.FindName("tb");
                tb.Cursor     = Cursors.Hand;
                tb.MouseDown += TextBlock_MouseUp;
            }

            Button button = (Button)gb.FindName("navigate");

            if (pv.FullScreen == null)
            {
                button.Visibility = System.Windows.Visibility.Collapsed;
            }
            else
            {
                button.Click += fullScreen_Click;
            }
        }