Пример #1
0
        /// <summary>
        /// 依赖项属性发生改变时,触发的事件:
        /// 当RecordTypeProperty依赖项属性,的属性值发生改变的时候,调用这个方法
        /// </summary>
        /// <param name="sender">依赖项对象</param>
        /// <param name="e">依赖项属性改变事件 的参数(里面有这个属性的新的值,和旧的值)</param>
        private static void OnRecordTypeChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            //取到控件
            RecordListItemControl _recordListItemControl = sender as RecordListItemControl;

            //判断类型
            switch ((RecordType)e.NewValue)
            {
            //如果为[空]
            case RecordType.None:
                _recordListItemControl.BugGrid.Visibility  = Visibility.Collapsed;
                _recordListItemControl.BearGrid.Visibility = Visibility.Collapsed;
                break;

            //如果为[虫子]
            case RecordType.Bug:
                _recordListItemControl.BugGrid.Visibility  = Visibility.Visible;
                _recordListItemControl.BearGrid.Visibility = Visibility.Collapsed;
                break;

            //如果为[熊]
            case RecordType.Bear:
                _recordListItemControl.BugGrid.Visibility  = Visibility.Collapsed;
                _recordListItemControl.BearGrid.Visibility = Visibility.Visible;
                break;
            }
        }
        //当点击某一个[记录Item]中的 某一个[图片]按钮时
        private void RecordListItemControl_ClickImageButton(object sender, RoutedPropertyChangedEventArgs <string> e)
        {
            //取到控件
            RecordListItemControl _recordListItemControl = sender as RecordListItemControl;

            //触发事件
            this.OnClickRecordListItemImageButton(e.NewValue);
        }
        //当点击某一个[记录Item]中的[删除]按钮时
        private void RecordListItemControl_ClickDeleteButton(object sender, RoutedPropertyChangedEventArgs <bool> e)
        {
            //取到控件
            RecordListItemControl _recordListItemControl = sender as RecordListItemControl;

            //取到控件的数据源
            RecordItemData _data = (RecordItemData)_recordListItemControl.Tag;

            //触发事件
            this.OnClickRecordListItemDeleteButton(_data.Data);
        }
Пример #4
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.RecordListItemUserControl = ((EasyBugManager.RecordListItemControl)(target));
                return;

            case 2:
                this.BearGrid = ((System.Windows.Controls.Grid)(target));
                return;

            case 3:
                this.TimeTextBlock = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 4:
                this.BearBubbleBorder = ((System.Windows.Controls.Border)(target));

            #line 70 "..\..\..\..\..\..\Xaml\Control\Perfab\BugUi\RecordListItemControl.xaml"
                this.BearBubbleBorder.MouseLeave += new System.Windows.Input.MouseEventHandler(this.BearBubbleBorder_MouseLeave);

            #line default
            #line hidden

            #line 71 "..\..\..\..\..\..\Xaml\Control\Perfab\BugUi\RecordListItemControl.xaml"
                this.BearBubbleBorder.MouseEnter += new System.Windows.Input.MouseEventHandler(this.BearBubbleBorder_MouseEnter);

            #line default
            #line hidden
                return;

            case 5:
                this.BearTextBox = ((System.Windows.Controls.TextBox)(target));
                return;

            case 6:
                this.DeleteButtonControl = ((EasyBugManager.ImageButtonControl)(target));
                return;

            case 7:
                this.BugGrid = ((System.Windows.Controls.Grid)(target));
                return;

            case 8:
                this.BugBubbleBorder = ((System.Windows.Controls.Border)(target));
                return;

            case 9:
                this.BugTextBlock = ((System.Windows.Controls.TextBlock)(target));
                return;
            }
            this._contentLoaded = true;
        }