Telerik Forums
UI for WPF Forum
1 answer
163 views
How to Suspend Find Replace Dialog when Pressing Ctrl +F
Anna
Telerik team
 answered on 26 Jul 2013
1 answer
130 views

hi

i was given a solution to enable to re-template the AxisLabel2d controls which worked fine. See attached

When i resize the window, the labels revert back to the defaulted state (timedate), initally it is fine.

My converter does nothing but return a string. I restyle using the code below (as per the suggestion by you guys)

            ChartArea area = _CA;
            HorizontalAxisLabels2D axisLabelsContainer = area.FindChildByType<HorizontalAxisLabels2D>();
            var axisLabels = axisLabelsContainer.ChildrenOfType<AxisLabel2D>();
            System.Windows.Style style = _GD.Resources["CustomLabel"] as System.Windows.Style;
            foreach (var item in axisLabels)
            {
                item.Style = style;
            }


    public class GetTextConverter : IValueConverter, IMultiValueConverter
    {
        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
        {
            return "I Am HERE";
        }
       
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return "I Am HERE";
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException();}
        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) { throw new NotImplementedException(); }
    }

 


<Style x:Key="CustomLabel" TargetType="telerikCharting:AxisLabel2D">
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="telerikCharting:AxisLabel2D">
                <Border Background="{TemplateBinding Background}">
                    <Border.DataContext>
                        <MultiBinding Converter="{StaticResource GetTextConverter}">
                            <MultiBinding.Bindings>
                                <Binding Path="DataContext" ElementName="_GD"/>
                                <Binding Path="CurrentIndex"/>
                            </MultiBinding.Bindings>
                        </MultiBinding>
                    </Border.DataContext>
                    <TextBlock Style="{TemplateBinding ItemLabelStyle}" Text="{Binding .}">
                        <TextBlock.LayoutTransform>
                            <RotateTransform x:Name="PART_RotateTransform" />
                        </TextBlock.LayoutTransform>
                    </TextBlock>
                </Border>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

Evgenia
Telerik team
 answered on 26 Jul 2013
2 answers
172 views
Hello,

I am trying to animate the position of a RadWindow using a DataTrigger.

The following demonstrates what I am trying to achieve:

<telerik:RadWindow x:Class="TelerikRadWindow.MainWindow"
        Height="350"
        Width="525"
        WindowStartupLocation="CenterScreen">
    <telerik:RadWindow.Style>
        <Style TargetType="telerik:RadWindow">
            <Style.Triggers>
                <DataTrigger Binding="{Binding ShouldMoveWindow}" Value="True">
                    <DataTrigger.EnterActions>
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation Storyboard.TargetProperty="(Window.Top)" To="+200" BeginTime="0:0:0" Duration="0:0:5" />
                            </Storyboard>
                        </BeginStoryboard>
                    </DataTrigger.EnterActions>
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </telerik:RadWindow.Style>
</telerik:RadWindow>

namespace TelerikRadWindow
{
    public partial class MainWindow
    {
        public MainWindow()
        {
            InitializeComponent();
            ShouldMoveWindow = true;
            DataContext = this;
        }
 
        public bool ShouldMoveWindow { get; set; }
    }
}

When loaded, an exception is thrown:

System.Windows.Media.Animation.AnimationException was unhandled
  HResult=-2146233087
  Message=Cannot animate the 'Top' property on a 'TelerikRadWindow.MainWindow' using a 'System.Windows.Media.Animation.DoubleAnimation'. For details see the inner exception.
  Source=PresentationCore
  StackTrace:
       at System.Windows.Media.Animation.AnimationStorage.OnCurrentTimeInvalidated(Object sender, EventArgs args)
       at System.Windows.Media.Animation.Clock.FireEvent(EventPrivateKey key)
       at System.Windows.Media.Animation.Clock.RaiseAccumulatedEvents()
       at System.Windows.Media.Animation.TimeManager.RaiseEnqueuedEvents()
       at System.Windows.Media.Animation.TimeManager.Tick()
       at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
       at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.DispatcherOperation.InvokeImpl()
       at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Windows.Threading.DispatcherOperation.Invoke()
       at System.Windows.Threading.Dispatcher.ProcessQueue()
       at System.Windows.Threading.Dispatcher.WndProcHook(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 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, 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.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
       at System.Windows.Threading.Dispatcher.Run()
       at System.Windows.Application.RunDispatcher(Object ignore)
       at System.Windows.Application.RunInternal(Window window)
       at System.Windows.Application.Run(Window window)
       at System.Windows.Application.Run()
       at TelerikRadWindow.App.Main() in c:\Users\martin.galpin\Documents\Visual Studio 2012\Projects\TelerikRadWindow\TelerikRadWindow\obj\Debug\App.g.cs:line 0
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: System.InvalidOperationException
       HResult=-2146233079
       Message='System.Windows.Media.Animation.DoubleAnimation' cannot use default origin value of 'NaN'.
       Source=PresentationCore
       StackTrace:
            at System.Windows.Media.Animation.DoubleAnimation.GetCurrentValueCore(Double defaultOriginValue, Double defaultDestinationValue, AnimationClock animationClock)
            at System.Windows.Media.Animation.DoubleAnimationBase.GetCurrentValue(Double defaultOriginValue, Double defaultDestinationValue, AnimationClock animationClock)
            at System.Windows.Media.Animation.DoubleAnimationBase.GetCurrentValue(Object defaultOriginValue, Object defaultDestinationValue, AnimationClock animationClock)
            at System.Windows.Media.Animation.AnimationClock.GetCurrentValue(Object defaultOriginValue, Object defaultDestinationValue)
            at System.Windows.Media.Animation.AnimationLayer.GetCurrentValue(Object defaultDestinationValue)
            at System.Windows.Media.Animation.AnimationStorage.GetCurrentPropertyValue(AnimationStorage storage, DependencyObject d, DependencyProperty dp, PropertyMetadata metadata, Object baseValue)
            at System.Windows.Media.Animation.AnimationStorage.OnCurrentTimeInvalidated(Object sender, EventArgs args)
       InnerException:

This exact same sample works when using a Window rather than a RadWindow.

Does anybody have any idea why this is or what I can do to resolve it?

Many thanks.




MobiusStrip
Top achievements
Rank 1
 answered on 26 Jul 2013
1 answer
119 views
is this possible?
Petya
Telerik team
 answered on 25 Jul 2013
5 answers
217 views
I am using the RadRichTextBox to input and display various types of data. So far text input works fine. However when I copy and paste an image it seems to appear in the RadRichTextBox but the actual image is invisible. I would like to have text, tables, images and files if possible inside my RadRichTextBox. Here's some code that I've tried thus far. As I understand it XamlDataProvider takes a string in xaml format as its data source. Which is fine but then I don't understand how binary files like images are handled. A code sample in the mvvm pattern would be great. Thank you.
<StackPanel>
    <telerikXaml:XamlDataProvider RichTextBox="{Binding ElementName=radRich}" Xaml="{Binding Path=XamlText, Mode=TwoWay}"></telerikXaml:XamlDataProvider>
    <telerik:RadRichTextBox x:Name="radRich" />
</StackPanel>

private string xamlText;
public string XamlText
{
    get { return xamlText; }
    set
    {
        if (xamlText != value)
        {
            xamlText = value;
            RaisePropertyChanged("XamlText");
        }
    }
}

Petya
Telerik team
 answered on 25 Jul 2013
1 answer
85 views
is it possible to perform Find Replace in MVVM?
Petya
Telerik team
 answered on 25 Jul 2013
1 answer
121 views
Hi,

I have a wpf desktop app using your radrichtext box and I find it fits my purpose very well.
My raddocument uses a lot of custom annotations.

Other than silverlight, do you intend to create a web app say in your kendo or asp ajax  product ranges that is capable of loading xaml docs?
This would be a really useful feature for me when I want to display my documents via the web to my customers.

Thanks,

Rob
Petya
Telerik team
 answered on 25 Jul 2013
1 answer
360 views
Is it possible somehow to bind the Ticks source to a list of strings? For example A, B, C, D, E etc

I want to use the slider to change between different modes rather then just use its numerical values :)

Kind regards
Christopher
Pavel R. Pavlov
Telerik team
 answered on 25 Jul 2013
3 answers
65 views

I have used custom appointment in my project and added a "VisitTime" time property in the appointment template. When I load my calendar for the first time the time reflects correctly in the Appointment tile but when I change the time in code for that appointment, the changes are not getting reflected properly in the appointment tile in UI. The "VisitTime" property is defined as below and is defined in the VisitAppointment class derived from appointment class of telerik.

 public DateTimeOffset VisitTime
        {
            get { return _visitTime; }
            set
            {
                _visitTime = value;
                OnPropertyChanged(() => VisitTime);
            }
        }

 I tried using Edit() and Commit() method which are provided by default from telerik in order to update the changes in the UI. I passed the modified appointments collection(i.e custom appointments derived from telerik Appointment class) in the Edit() method and then later on called Commit() but still the changes are not getting reflected until and unless I reload the calendar (i.e fetch data from database again and then create the appointments collection from scratch).

 Please help me out with the necessary things that you think I might have missed out.

 Thanks in advance.

Ventzi
Telerik team
 answered on 25 Jul 2013
1 answer
150 views
When grouping properties into categories is enabled, vertical scrollbar dispappears.

See attached sample and click on button in left top corner in order to group properties
https://skydrive.live.com/redir?resid=51A46BBA4E9EF07E!1482&authkey=!ABBtAamej6wpD5A
Daniel
Top achievements
Rank 1
 answered on 25 Jul 2013
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?