Interaction logic for TextViewItem.xaml
Inheritance: System.Windows.Controls.UserControl
        private void _tkTreeViewItem_MouseEnter(object sender, MouseEventArgs e)
        {
            TextViewItem item = sender as TextViewItem;

            if (item != null)
            {
                if (!item.IsSelected)
                {
                    item.SetState(TviState.MouseOver);
                }
            }
        }
Beispiel #2
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (targetType != typeof(double))
            {
                return(null);
            }
            if (!(value is Border))
            {
                return(0);
            }

            Border text = (Border)value;

            TextViewItem res = WpfUtilities.FindDirectParentControl <TextViewItem>(text);

            if (res == null)
            {
                return(text.ActualWidth);
            }

            ListView view = res.ListView;

            if (view == null)
            {
                return(text.ActualWidth);
            }

            if (view.ActualWidth < 0)
            {
                return(0);
            }

            double dParentWidth   = view.ActualWidth;
            double dToAdjust      = parameter == null ? 0 : double.Parse(parameter.ToString());
            double dAdjustedWidth = dParentWidth + dToAdjust - 10;

            if (_isScrollBarVisible(view))
            {
                dAdjustedWidth -= SystemParameters.VerticalScrollBarWidth;
            }

            return(dAdjustedWidth < 0 ? 0 : dAdjustedWidth);
        }
Beispiel #3
0
		private void _loadTxtFiles() {
			_tviItemDb = new TextViewItem(null, ProjectConfiguration.DatabasePath, _metaGrf, SdeFiles.ServerDbPath) { Description = "Server DB path" };
			_tviItemDb.Browser.BrowseMode = PathBrowser.BrowseModeType.Folder;
			_tviItemDb.HorizontalAlignment = HorizontalAlignment.Left;
			_tviItemDb.Margin = new Thickness(4, 0, 0, 0);
			
			_gridTextFilesSettings.Children.Add(_tviItemDb);
			_gridTextFilesSettings.SizeChanged += new SizeChangedEventHandler(_grid_SizeChanged);
		}