コード例 #1
0
        void dayBox_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (e.Source is DayBoxControl)
            {
                //VisualTreeAdapter t = new VisualTreeAdapter(e.OriginalSource as DependencyObject);
                //DependencyObject  k = t.Parent;

                if (e.OriginalSource is TextBlock)
                {
                    TextBlock t = e.OriginalSource as TextBlock;
                    if (t.Name.Equals("DisplayText"))
                    {
                        return;
                    }
                }

                NewAppointmentEventArgs ev = new NewAppointmentEventArgs();
                DayBoxControl           d  = e.Source as DayBoxControl;
                ev.StartDate   = DisplayStartDate.AddDays(Double.Parse(d.Tag.ToString()) - 1).Date;
                ev.RoutedEvent = DayBoxDoubleClickedEvent;
                RaiseEvent(ev);
                e.Handled = true;
            }
        }
コード例 #2
0
        void dayBox_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (e.Source is DayBoxControl ) 
            {
                //VisualTreeAdapter t = new VisualTreeAdapter(e.OriginalSource as DependencyObject);
                //DependencyObject  k = t.Parent;

                if (e.OriginalSource is TextBlock)
                {
                    TextBlock t = e.OriginalSource as TextBlock;
                    if(t.Name.Equals("DisplayText")){
                        return;
                    }
                }

                NewAppointmentEventArgs ev = new NewAppointmentEventArgs();
                DayBoxControl d = e.Source as DayBoxControl;
                ev.StartDate = DisplayStartDate.AddDays(Double.Parse(d.Tag.ToString())-1).Date;
                ev.RoutedEvent = DayBoxDoubleClickedEvent;
                RaiseEvent(ev);
                e.Handled = true;

            }
        }