Ejemplo n.º 1
0
        void FloatingDialog_Loaded(object sender, RoutedEventArgs e)
        {
            if (App.InDesignMode)
            {
                return;
            }

            VisualTree.GetParent <Grid>(this).Children.Remove(this);
            App.CurrentPage.Window.FloatingDialogContainer.Children.Add(this);
        }
Ejemplo n.º 2
0
        public override Style SelectStyle(object item, DependencyObject container)
        {
            ListTable tbl = VisualTree.GetParent <ListTable>(container);

            // buggy
            //int index = tbl.ListView.ItemContainerGenerator.IndexFromContainer(container);
            //string alternate = index % 2 == 0 ? string.Empty : "-alternate";

            string alternate = null;

            if (tbl.ChildItemTypes != null && tbl.ChildItemTypes.Contains(item.GetType()))
            {
                return(tbl.ListView.FindResource(String.Format("ChildItemStyle{0}", alternate)) as Style);
            }
            else
            {
                return(tbl.ListView.FindResource(String.Format("ParentItemStyle{0}", alternate)) as Style);
            }
        }