コード例 #1
0
ファイル: EventHelpers.cs プロジェクト: Abbas1546/WPF
 static void shapeLayer_ShapesLoaded(object sender, ShapesLoadedEventArgs args)
 {
     if ((sender as ShapeFileLayer).ShapeCollection.Count > 0)
     {
         canvas = VirtualizationViewModel.FindParent <ShapeFilePanel>((sender as ShapeFileLayer).ShapeCollection[0] as UIElement);
         ShapeFileEventHelper.GetShapeFileEvents(sender as ShapeFileLayer).Execute(canvas);
         canvas.LayoutUpdated += new EventHandler(canvas_LayoutUpdated);
     }
 }
コード例 #2
0
ファイル: ViewModel.cs プロジェクト: Abbas1546/WPF
        internal static T FindChild <T>(UIElement control) where T : UIElement
        {
            UIElement p = VisualTreeHelper.GetChild(control, 0) as UIElement;

            if (p != null)
            {
                if (p is T)
                {
                    return(p as T);
                }
                else
                {
                    return(VirtualizationViewModel.FindChild <T>(p));
                }
            }
            return(null);
        }