Is there a way I can wire up hyperlinks to open when the user clicks on them with the middle mouse button?
Hallo,
I am using this code to fill the Editor With code:
public
void
Test()
{
using
(StreamReader reader =
new
StreamReader(
"../../ViewModels/ShellViewModel.cs"
, Encoding.UTF8))
{
SyntaxEditor.Document =
new
TextDocument(reader);
}
CSharpTagger cSharpTagger =
new
CSharpTagger(SyntaxEditor);
SyntaxEditor.TaggersRegistry.RegisterTagger(cSharpTagger);
}
This does not Show any result. The SyntaxEditor is initialized and editable. But the code from ShellViewModel.cs is not showing (it is correctly loaded in the reader). Also when I type keywords into the editor, they are not highlighted. The SyntaxEditor.Document.CurrentSnapshot also does show that at least something is loaded (correct lenght and linecount).
I am creating a dynamic chart with a seriesdescriptorselector that changes the type of the X-axis (DateTimeContinuous or Linear) based on user defined settings. I am also setting a grid for the horizontal and vertical axis of the chart. The problem I am having is that only the horizontal lines of the grid are showing up on the chart. I get no vertical lines at all regardless of whether the horizontal axis is Linear of DateTimeContinuous. Does the use of a series descriptor selector invalidate the grid lines for the axis?
Thank you
We've seen a crash in our application when the RadMap control is disposed. We've only seen the crash once but have been unable to reproduce. The stack trace is as follows:
Telerik.Windows.Controls.DataVisualization : System.NullReferenceException
Object reference not set to an instance of an object.
at Telerik.Windows.Controls.Map.Location.PixelToLogical(RadMap mapControl, Point pixel, Boolean useTileLayer)
at Telerik.Windows.Controls.Map.Location.PixelToLogical(RadMap mapControl, Point pixel, Boolean useTileLayer)
at Telerik.Windows.Controls.Map.MapMouseLocationIndicator.MapControl_MouseMove(Object sender, MouseEventArgs e)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at CNL.IPSecurityCenter.WindowsClient.App.Main()
We're currently using version 2017.2.614.45. Looking at the Telerik code it seems like the mouse event handler for MapMouseLocationIndicator doesn't get detached when RadMap is disposed. Is it possible there's some race condition that allows a mouse event to be processed in MapMouseLocationIndicator after its RadMap property has been set to null (which does happen when RadMap is disposed)?
Thanks
Pete
We are having an issue with the CellStyleSelector randomly changing the style when scrolling left and right in the GridView.
We have it narrowed down to our comparison in the StyleSelector code. We need to compare the cell value to the Min and Max columns to see if it is within the range. If it is, set the style to Valid, if not set it to Invalid.
This works on loading of the grid, but the scrolling causes it to glitch.
Code where the value of comparison (cell) changes and causes glitch:
public
class
ValidationStyle : StyleSelector
{
public
override
Style SelectStyle(
object
item, DependencyObject container)
{
if
(item
is
ExpandoObject)
{
var inspection = (IDictionary<
string
,
object
>)item;
var cell = container.GetValue(GridViewCell.ValueProperty);
if
(!(cell ==
null
|| cell.ToString() ==
""
))
{
double
.TryParse(cell.ToString(),
out
double
cellValue);
inspection.TryGetValue(
"Max"
,
out
object
maxValue);
inspection.TryGetValue(
"Min"
,
out
object
minValue);
if
((
double
)minValue <= cellValue && cellValue <= (
double
)maxValue)
{
return
Valid;
}
else
{
return
Invalid;
}
}
}
return
null
;
}
public
Style Valid {
get
;
set
; }
public
Style Invalid {
get
;
set
; }
}
Code example using a fixed value of comparison (cell) and does not glitch:
public
class
ValidationStyle : StyleSelector
{
public
override
Style SelectStyle(
object
item, DependencyObject container)
{
if
(item
is
ExpandoObject)
{
var inspection = (IDictionary<
string
,
object
>)item;
int
? cell = 1;
if
(!(cell ==
null
|| cell.ToString() ==
""
))
{
double
.TryParse(cell.ToString(),
out
double
cellValue);
inspection.TryGetValue(
"Max"
,
out
object
maxValue);
inspection.TryGetValue(
"Min"
,
out
object
minValue);
if
((
double
)minValue <= cellValue && cellValue <= (
double
)maxValue)
{
return
Valid;
}
else
{
return
Invalid;
}
}
}
return
null
;
}
public
Style Valid {
get
;
set
; }
public
Style Invalid {
get
;
set
; }
}
We have poured over these forums and every example for StyleSelector uses a fixed value for comparison.
We have applied this concept to the NegativeStyleSelector.zip in this forum and it also glitches: https://www.telerik.com/forums/apply-cellstyleselector-in-code-behind
Any help would be appreciated!
Thanks!
I am getting a strange error on a customer PC with RadGlyph's. They have a vanilla Win7 box with .Net 4.5.1, any idea what might cause this? It works fine on my Win7 machine so I'm not sure where to look.
System.Windows.Markup.XamlParseException: Set property
'Telerik.Windows.Controls.RadGlyph.Glyph'
threw an exception. ---> System.IO.FileFormatException: Input file or data stream does not conform to the expected file format specification.<br> at MS.Internal.Text.TextInterface.Native.Util.ConvertHresultToException(Int32 hr)<br> at MS.Internal.Text.TextInterface.Font.CreateFontFace()<br> at MS.Internal.Text.TextInterface.Font.AddFontFaceToCache()<br> at MS.Internal.Text.TextInterface.Font.GetFontFace()<br> at System.Windows.Media.GlyphTypeface..ctor(Font font)<br> at MS.Internal.FontFace.PhysicalFontFamily.GetGlyphTypeface(FontStyle style, FontWeight weight, FontStretch stretch)<br> at MS.Internal.FontFace.PhysicalFontFamily.MS.Internal.FontFace.IFontFamily.GetTypefaceMetrics(FontStyle style, FontWeight weight, FontStretch stretch)<br> at System.Windows.Media.Typeface.ConstructCachedTypeface()<br> at System.Windows.Media.Typeface.get_CachedTypeface()<br> at System.Windows.Media.Typeface.CheckFastPathNominalGlyphs(CharacterBufferRange charBufferRange, Double emSize, Double scalingFactor, Double widthMax, Boolean keepAWord, Boolean numberSubstitution, CultureInfo cultureInfo, TextFormattingMode textFormattingMode, Boolean isSideways, Boolean breakOnTabs, Int32& stringLengthFit)<br> at MS.Internal.TextFormatting.SimpleRun.CreateSimpleTextRun(CharacterBufferRange charBufferRange, TextRun textRun, TextFormatterImp formatter, Int32 widthLeft, Boolean emergencyWrap, Boolean breakOnTabs)<br> at MS.Internal.TextFormatting.SimpleRun.Create(FormatSettings settings, CharacterBufferRange charString, TextRun textRun, Int32 cp, Int32 cpFirst, Int32 runLength, Int32 widthLeft, Int32 idealRunOffsetUnRounded)<br> at MS.Internal.TextFormatting.SimpleTextLine.Create(FormatSettings settings, Int32 cpFirst, Int32 paragraphWidth)<br> at MS.Internal.TextFormatting.TextFormatterImp.FormatLineInternal(TextSource textSource, Int32 firstCharIndex, Int32 lineLength, Double paragraphWidth, TextParagraphProperties paragraphProperties, TextLineBreak previousLineBreak, TextRunCache textRunCache)<br> at MS.Internal.TextFormatting.TextFormatterImp.FormatLine(TextSource textSource, Int32 firstCharIndex, Double paragraphWidth, TextParagraphProperties paragraphProperties, TextLineBreak previousLineBreak)<br> at System.Windows.Media.FormattedText.LineEnumerator.FormatLine(TextSource textSource, Int32 textSourcePosition, Double maxLineLength, TextParagraphProperties paraProps, TextLineBreak lineBreak)<br> at System.Windows.Media.FormattedText.LineEnumerator.MoveNext()<br> at System.Windows.Media.FormattedText.DrawAndCalculateMetrics(DrawingContext dc, Point drawingOffset, Boolean getBlackBoxMetrics)<br> at System.Windows.Media.FormattedText.get_Metrics()<br> at Telerik.Windows.Controls.RadGlyph.CalculateElementDesiredSize()<br> at Telerik.Windows.Controls.RadGlyph.RemeasureElement(DependencyObject d, DependencyPropertyChangedEventArgs e)<br> at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)<br> at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)<br> at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)<br> at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)<br> at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)<br> at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)<br> at System.Windows.Baml2006.WpfMemberInvoker.SetValue(Object instance, Object value)<br> at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(XamlMember member, Object obj, Object value)<br> at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(Object inst, XamlMember property, Object value)<br> --- End of inner exception stack trace ---<br> at System.Windows.FrameworkTemplate.LoadTemplateXaml(XamlReader templateReader, XamlObjectWriter currentWriter)<br> at System.Windows.FrameworkTemplate.LoadTemplateXaml(XamlObjectWriter objectWriter)<br> at System.Windows.FrameworkTemplate.LoadOptimizedTemplateContent(DependencyObject container, IComponentConnector componentConnector, IStyleConnector styleConnector, List`1 affectedChildren, UncommonField`1 templatedNonFeChildrenField)<br> at System.Windows.FrameworkTemplate.LoadContent(DependencyObject container, List`1 affectedChildren)<br> at System.Windows.StyleHelper.ApplyTemplateContent(UncommonField`1 dataField, DependencyObject container, FrameworkElementFactory templateRoot, Int32 lastChildIndex, HybridDictionary childIndexFromChildID, FrameworkTemplate frameworkTemplate)<br> at System.Windows.FrameworkTemplate.ApplyTemplateContent(UncommonField`1 templateDataField, FrameworkElement container)<br> at System.Windows.FrameworkElement.ApplyTemplate()<br> at System.Windows.FrameworkElement.MeasureCore(Size availableSize)<br> at System.Windows.UIElement.Measure(Size availableSize)<br> at System.Windows.Controls.Control.MeasureOverride(Size constraint)<br> at System.Windows.FrameworkElement.MeasureCore(Size availableSize)<br> at System.Windows.UIElement.Measure(Size availableSize)<br> at System.Windows.Controls.DockPanel.MeasureOverride(Size constraint)<br> at System.Windows.FrameworkElement.MeasureCore(Size availableSize)<br> at System.Windows.UIElement.Measure(Size availableSize)<br> at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)<br> at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)<br> at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)<br> at System.Windows.Controls.Grid.MeasureOverride(Size constraint)<br> at System.Windows.FrameworkElement.MeasureCore(Size availableSize)<br> at System.Windows.UIElement.Measure(Size availableSize)<br> at System.Windows.Controls.Border.MeasureOverride(Size constraint)<br> at System.Windows.FrameworkElement.MeasureCore(Size availableSize)<br> at System.Windows.UIElement.Measure(Size availableSize)<br> at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)<br> at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)<br> at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)<br> at System.Windows.Controls.Grid.MeasureOverride(Size constraint)<br> at System.Windows.FrameworkElement.MeasureCore(Size availableSize)<br> at System.Windows.UIElement.Measure(Size availableSize)<br> at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)<br> at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)<br> at System.Windows.FrameworkElement.MeasureCore(Size availableSize)<br> at System.Windows.UIElement.Measure(Size availableSize)<br> at System.Windows.Documents.AdornerDecorator.MeasureOverride(Size constraint)<br> at System.Windows.FrameworkElement.MeasureCore(Size availableSize)<br> at System.Windows.UIElement.Measure(Size availableSize)<br> at System.Windows.Controls.Border.MeasureOverride(Size constraint)<br> at System.Windows.FrameworkElement.MeasureCore(Size availableSize)<br> at System.Windows.UIElement.Measure(Size availableSize)<br> at System.Windows.Window.MeasureOverrideHelper(Size constraint)<br> at System.Windows.Window.MeasureOverride(Size availableSize)<br> at System.Windows.FrameworkElement.MeasureCore(Size availableSize)<br> at System.Windows.UIElement.Measure(Size availableSize)<br> at System.Windows.ContextLayoutManager.UpdateLayout()<br> at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)<br> at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()<br> at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()<br> at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)<br> at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)<br> at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)<br> at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
When user clicks on X, I want to check whether there are any unsaved changes in the page.
I have isNotSaved Property which tells me that.
Now, if there are any unsaved changes, I want to show Alert window(which is in place) to confirm by user to close pane or not.
If user says Yes, I want to close, If not I dont want to close.
How can I implement this in Pure MVVM ?