In my application, I have a outlook bar which has some menu items. On click event of mneu Item I want to traverse the visual tree upto main Window. For normal view of Outlook bar it is working properly but for collapsed view of outlook bar when I click menu item it traverse till PopUpRoot control only. Parent of this control returns null.
var parent = VisualTreeHelper.GetParent(this);
while (!(parent is Window))
{
parent = VisualTreeHelper.GetParent(parent);
}

I have a RichTextBox that I am searching. When the search result is selected the text is then highlighted correctly. However, once the RichTextBox is scrolled, the highlight does not follow the text that was highlighted, but instead stays where the text was initially found (see attached screenshot). Below is the code that highlights the desired text initially. Any thoughts on how to get the highlight to follow the text as it is scrolled?
01.class SearchResult02.{03. public string Display { get; set; }04. public TextPointer Start { get; set; }05. public TextPointer End { get; set; }06.}07. 08.public void DoSearch()09.{10. string toSearch = TextBox_Find.Text.Replace(@"\", @"\\")11. .Replace("^", @"\^")12. .Replace("$", @"\$")13. .Replace(".", @"\.")14. .Replace("|", @"\|")15. .Replace("?", @"\?")16. .Replace("*", @"\*")17. .Replace("+", @"\+")18. .Replace("(", @"\(")19. .Replace(")", @"\)")20. .Replace("[", @"\[")21. .Replace("]", @"\]")22. .Replace("{", @"\{")23. .Replace("}", @"\}");24. TextRange range = new TextRange(RichTextBox_AllComments.Document.ContentStart, RichTextBox_AllComments.Document.ContentEnd);25. Regex reg = new Regex(toSearch, RegexOptions.Compiled | RegexOptions.IgnoreCase);26. 27. var start = RichTextBox_AllComments.Document.ContentStart;28. while (start != null && start.CompareTo(RichTextBox_AllComments.Document.ContentEnd) < 0)29. {30. if (start.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.Text)31. {32. var matches = reg.Matches(start.GetTextInRun(LogicalDirection.Forward));33. TextRange textrange = null;34. foreach (Match match in matches)35. { 36. textrange = new TextRange(start.GetPositionAtOffset(match.Index, LogicalDirection.Forward), start.GetPositionAtOffset(match.Index + match.Length, LogicalDirection.Backward));37. SearchResults.Add(new SearchResult() { Display = "Result " + (SearchResults.Count + 1).ToString(), Start = textrange.Start, End = textrange.End });38. }39. if (textrange != null) start = textrange.End;40. }41. start = start.GetNextContextPosition(LogicalDirection.Forward);42. }43.}44. 45.private void ListBox_Find_SelectionChanged(object sender, SelectionChangedEventArgs e)46.{47. if (e.AddedItems.Count > 0)48. {49. bFindItemSelected = true;50. SearchResult sr = e.AddedItems[0] as SearchResult;51. RichTextBox_AllComments.Focus();52. RichTextBox_AllComments.Selection.Select(sr.Start, sr.End);53. ((UIElement)ListBox_Find.ItemContainerGenerator.ContainerFromItem(ListBox_Find.SelectedItem)).Focus();54. }55.}Hi,
I want to use multiple line series to compare some analog sensor values over several production runs.
The production runs start at different time or dates. To compare them all time values substracted from the production run start, thus i get a compareable timespan for each value.
I tried to use a TimeSpan data type but that seems not to work with the DateTime Axes. With a DateTime datatype it works but if a production run takes more than one day I can only show the day of month. I can't show the day value as day 1, day 2 ... because the DateTime format string has no "elapsed days" only day on week or day of month.
Is there a way to use a TimeSpan or customize the lable formatting.
Thank you for your help
Hi to all,
I'm creating new project with a Common Style Dictionary, and merged with application resource.
When I apply style to my control, this one disappers!
I tryed with RadWindow and Radbutton, same result.
I've attach several screeshots.
Can you help me to understand?
Hi guys,
I have a application that spits out new lines in this Gridviewer. All the new lines are added at the bottom of the viewer. The "normal" behavior of the scrolling bar is that new lines will be added at the top. Since my new lines are added the bottom I have to revert the scrolling method. Does anyone know if this is possible?
The tag Application in App.xaml is in error, after apply new theme at project
I chose VisualStudio2013 theme, I click "Configure Project" on my project, chose controls and theme, after that, it appears strange error:
"Object reference not set to an instance of object" highlighting Application tag. Why?
<Application x:Class="Brema.Client.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"> <Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="/Telerik.Windows.Themes.VisualStudio2013;component/Themes/System.Windows.xaml" /> <ResourceDictionary Source="/Telerik.Windows.Themes.VisualStudio2013;component/Themes/Telerik.Windows.Controls.xaml" /> <ResourceDictionary Source="/Telerik.Windows.Themes.VisualStudio2013;component/Themes/Telerik.Windows.Controls.Chart.xaml" /> <ResourceDictionary Source="/Telerik.Windows.Themes.VisualStudio2013;component/Themes/Telerik.Windows.Controls.Navigation.xaml" /> <ResourceDictionary Source="/Telerik.Windows.Themes.VisualStudio2013;component/Themes/Telerik.Windows.Controls.Docking.xaml" /> <ResourceDictionary Source="/Telerik.Windows.Themes.VisualStudio2013;component/Themes/Telerik.Windows.Controls.FixedDocumentViewers.xaml" /> <ResourceDictionary Source="/Telerik.Windows.Themes.VisualStudio2013;component/Themes/Telerik.Windows.Controls.Input.xaml" /> <ResourceDictionary Source="/Telerik.Windows.Themes.VisualStudio2013;component/Themes/Telerik.Windows.Controls.GridView.xaml" /> <ResourceDictionary Source="/Telerik.Windows.Themes.VisualStudio2013;component/Themes/Telerik.Windows.Controls.ScheduleView.xaml" /> <ResourceDictionary Source="Helpers/Themes/Telerik.ReportViewer.Wpf.xaml"/> <ResourceDictionary Source="Styles/CommonDictionary.xaml" /> <ResourceDictionary Source="Styles/IconDictionary.xaml" /> <ResourceDictionary Source="Styles/ToolBarDictionary.xaml" /> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Application.Resources></Application>Hi,
I have few tabs in TabControls. Application has ability to switch themes in runtime.
I need highlight some tabs due to some actions (e.g. new message received in the system and messages tab will be highlighted) in runtime. This might be blinking tab header but it should be in the current theme colors, for example if I set blue color for tab header - in some cases it will be ok, but if selected theme who has blue tabs by default - highlighted tab will be not visible.
How this can be implemented using viewmodel property binding or something like this. Do you have any examples or article?
Thank you
Hello,
We are currently using the radmap control to display a shape file (1MB) showing a map of the world.
The virtualization engine is also used in order to maximize the performance for this relatively large shape file.
It is used as follow (largely inspired by telerik examples):
<telerik:VisualizationLayer MapShapeVisualizationCreated="VisualizationLayer_MapShapeVisualizationCreated"MapShapeVisualizationRemoved="VisualizationLayer_MapShapeVisualizationRemoved"AutoHighlightMapShape="False" ><telerik:VisualizationLayer.VirtualizationSource><telerik:MapShapeDataVirtualizationSource x:Name="VirtualisationSource" BusyIndicator="{Binding ElementName=busyIndicator}"><telerik:MapShapeDataVirtualizationSource.Reader><telerik:AsyncShapeFileReader ReadShapeDataCompleted="AsyncShapeFileReader_ReadShapeDataCompleted" /></telerik:MapShapeDataVirtualizationSource.Reader></telerik:MapShapeDataVirtualizationSource></telerik:VisualizationLayer.VirtualizationSource><telerik:VisualizationLayer.ZoomLevelGridList><telerik:ZoomLevelGrid MinZoom="5" /><telerik:ZoomLevelGrid MinZoom="6" /><telerik:ZoomLevelGrid MinZoom="7" /><telerik:ZoomLevelGrid MinZoom="8" /><telerik:ZoomLevelGrid MinZoom="9" /><telerik:ZoomLevelGrid MinZoom="10" /><telerik:ZoomLevelGrid MinZoom="11" /><telerik:ZoomLevelGrid MinZoom="12" /></telerik:VisualizationLayer.ZoomLevelGridList><telerik:VisualizationLayer.ItemTemplate><DataTemplate><Rectangle Width="10"Height="10"telerik:MapLayer.Location="{Binding}"Fill="Transparent"MouseMove="Rectangle_MouseMove"StrokeThickness="2" telerik:MapLayer.ZoomRange="5,12"><!--<telerik:MapLayer.HotSpot><telerik:HotSpot X="0.5" Y="0.5" /></telerik:MapLayer.HotSpot>--></Rectangle></DataTemplate></telerik:VisualizationLayer.ItemTemplate> </telerik:VisualizationLayer>
A menu is displayed when the map is right clicked. It allows to add a start or a waypoint. A line is traced between the rectangles item
<telerik:RadMap.ContextMenu><ContextMenu><MenuItem Click="StartNewRouteMenuItem_Click" Header="Start new route" /><MenuItem x:Name="AddWayPointMenuItem"Click="AddWayPointMenuItem_Click" Header="Add way point"IsEnabled="False" /><MenuItem x:Name="EndRouteMenuItem" Click="EndRouteMenuItem_Click" Header="end route" IsEnabled="False" /> <MenuItem x:Name="ResetMenuItem" Click="ResetMenuItem_Click" Header="Reset route" IsEnabled="True" /> </ContextMenu>Firts issue :
When the map is right clicked the menu is shown, but the shape file disappears.
Moving the map will correct this.
Second issue :
While zooming out the lines and the rectangle disappears , while the shape file is correctly displayed.
Here is apart of the code behind :
/// <summary> /// Handles the MouseRightButtonDown event of the WorldRadMap control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.Windows.Input.MouseButtonEventArgs" /> instance containing the event data.</param> private void WorldRadMap_MouseRightButtonDown(object sender, MouseButtonEventArgs e) { previousMouseClickPos = lastMouseClickPos; lastMouseClickPos = e.GetPosition(WorldRadMap); Point1 = Point2; Point2 = Location.GetCoordinates(WorldRadMap, lastMouseClickPos); } /// <summary> /// Adds the point to map. /// </summary> /// <returns></returns> private bool AddPointToMap() { var location = Location.GetCoordinates(WorldRadMap, lastMouseClickPos); if (GribAPI_GTT.IsOnContinent(location.Longitude, location.Latitude)) { MessageBox.Show("WayPoint must be in open sea"); return false; } this.visualizationlayer.Items.Add(Location.GetCoordinates(WorldRadMap, lastMouseClickPos)); return true; } /// <summary> /// Draws the line. /// </summary> private void DrawLine() { LineData line = new LineData() { Point1 = Point1, Point2 = Point2, ShapeFill = new MapShapeFill() { Stroke = new SolidColorBrush(Colors.Purple), StrokeThickness = 2, } }; this.visualizationlayer.Items.Add(line); }
Is there a way that the items and the shapefile keep displaying
