Telerik Forums
UI for WPF Forum
1 answer
758 views
<Viewbox x:Key="organization">
        <Grid Width="128" Height="128" Visibility="Visible">
            <Path Data="M28,26C26.896999,26 26,26.896999 26,28 26,29.103001 26.896999,30 28,30 29.103001,30 30,29.103001 30,28 30,26.896999 29.103001,26 28,26z M16,26C14.897,26 14,26.896999 14,28 14,29.103001 14.897,30 16,30 17.103,30 18,29.103001 18,28 18,26.896999 17.103,26 16,26z M4,26C2.8969998,26 2,26.896999 2,28 2,29.103001 2.8969998,30 4,30 5.1029999,30 6,29.103001 6,28 6,26.896999 5.1029999,26 4,26z M28,24C30.205999,24 32,25.794001 32,28 32,30.205999 30.205999,32 28,32 25.794001,32 24,30.205999 24,28 24,25.794001 25.794001,24 28,24z M16,24C18.206,24 20,25.794001 20,28 20,30.205999 18.206,32 16,32 13.794,32 12,30.205999 12,28 12,25.794001 13.794,24 16,24z M4,24C6.2060001,24 8,25.794001 8,28 8,30.205999 6.2060001,32 4,32 1.7940001,32 0,30.205999 0,28 0,25.794001 1.7940001,24 4,24z M4.5,15.053021L27.5,15.053021C28.327,15.053021,29,15.72602,29,16.553017L29,23 27,23 27,17.053017 17,17.053017 17,23.000999 15,23.000999 15,17.053017 5,17.053017 5,23 3,23 3,16.553017C3,15.72602,3.6729999,15.053021,4.5,15.053021z M11,2L11,8 21,8 21,2z M10.5,0L21.5,0C22.326996,0,23,0.67297363,23,1.5L23,8.5C23,9.3270264,22.326996,10,21.5,10L17,10 17,14.032018 15,14.032018 15,10 10.5,10C9.6730042,10,9,9.3270264,9,8.5L9,1.5C9,0.67297363,9.6730042,0,10.5,0z" Stretch="Uniform" Fill="#FF235598" Width="98" Height="98" Margin="0,0,0,0" RenderTransformOrigin="0.5,0.5">
                <Path.RenderTransform>
                    <TransformGroup>
                        <TransformGroup.Children>
                            <RotateTransform Angle="0" />
                            <ScaleTransform ScaleX="1" ScaleY="1" />
                        </TransformGroup.Children>
                    </TransformGroup>
                </Path.RenderTransform>
            </Path>
        </Grid>
    </Viewbox>

 

I have icons that are available as XAML code (Viewbox). I would like to add a XAML Icon to the button. The following code works:

 

<telerik:RadButton Height="250" Width="250" Content="{DynamicResource organization}"/>

 

This code does not work:

<telerik:RadRibbonButton x:Name="btnShowDashbord" Content="Home" LargeImage="{DynamicResource organization}" Size="Large" />

 

How can I include an XAML icon as ImageSource?

 

 

Tanya
Telerik team
 answered on 09 Nov 2016
2 answers
87 views

Hi,

We've created a base class/control which implements RadGridView (i.e. BaseGridView : RadGridView) which features code-behind logic that is bound to the UI's RadGridView, which we'd like to use across our application to elimintate repeated code.

We were able to create a solution that worked, however, we were required to create the RadContextMenu and the items manually in the base controls' constructor, where we would prefer to declare the RadContextMenu and the items in the XAML of the base control, like so:

<telerik:RadGridView x:Class="MyModule.BaseGridView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
...
<telerik:RadContextMenu x:Name="GridContextMenu">
            <telerik:RadContextMenu.Items>
                <telerik:RadMenuItem Name="mnuFilterItem" Header="Filter Selected" Click="FilterMenuItem_OnClick"/>
            </telerik:RadContextMenu.Items>
        </telerik:RadContextMenu>
</telerik:RadContextMenu.ContextMenu>
...
</telerik:RadGridView>

Here is sample usage in a View which implements the base control:

...

<views:BaseGridView Grid.Row="1" 
                            ItemsSource="{Binding Path=MyData}" 
                             AutoGenerateColumns="False" 
                             IsReadOnly="False" 
                             RowIndicatorVisibility="Visible"
                             HorizontalAlignment="Stretch"
                             SelectionMode="Extended"
                             SelectionUnit="Mixed"
                             ClipboardPasteMode="AllSelectedCells">

...

The XAML implementation is triggering the FilterMenuItem_OnClick event from the View which inherits this base view/control, however, we are experiencing a XAML exception when viewing the XAML in the designer of the View which is implementing the base control:

Method not found: 'Void Telerik.Windows.Controls.RadMenuItem.add_Click(Telerik.Windows.RadRoutedEventHandler)'.

 

Kindly advise. We have also tried manually hooking up the filter's click event in code-behind in the inheriting View's constructor like so:

mnuFilterItem.Click += new RadRoutedEventHandler(FilterMenuItem_OnClick);

However, the XAML exception in the implementing View persists.

 

Kind regards

Stefan Nenchev
Telerik team
 answered on 09 Nov 2016
5 answers
751 views
Hi,

How do I check if selectedItem intersects or overlap other shape on mouseUp?
Petar Mladenov
Telerik team
 answered on 09 Nov 2016
8 answers
212 views

Hello,

I have a very basic statement for adding InlineUIContainers to my RadRichTextBox:

var customControl = new â€‹CustomControl((​CustomObject)container.SelectedObject) { Height = 480, Width = 270 }; ​
var uiContainer      = new InlineUIContainer(customControl , new Size(480,270));
this.SelectedView.TelerikRichTextBox.InsertInline(uiContainer);

The custom control successfully displays within the RadRichTextbox, and can be size accordingly.  The problem is when I export as PDF, the resulting render control to image becomes distorted and no longer acceptable for document presentation.  The export code is as follows:

 

public byte[] ExportPDF()
{     
    PdfFormatProvider provider = new PdfFormatProvider();           
    provider.ExportSettings = new PdfExportSettings();     
    provider.ExportSettings.InlineUIContainersExportMode = PdfInlineUIContainersExportMode.Image;
    return provider.Export(this.TelerikRichTextBox.Document);
}

 

Are there properties that I am unaware of that will aid in proper rendering of the control?  

Tanya
Telerik team
 answered on 09 Nov 2016
2 answers
170 views

Ok, so I'm doing a vstudio-like interface using raddocking. I have a pane group on the left and right and mode of the user interaction will be with the right group.

I also have a radmenu and radtoolbar at the top of the main window. I have a File/Close menu option. It's bound to a CloseCommand in my MainWindow's viewmodel but I get stuck there.

Using MVVM, how best to close the RadPane? I can add the EventToCommandBehavior to the xaml. Then I can catch the command in my MainWindow's ViewModel. The problem is that once I'm in the ViewModel, I don't know how to tell the RadPane's View to close the pane in such a way that it's PreviewClose event fires so I can test to see if the user wants to save changes etc. Supposedly, in MVVM, you're not supposed to be playing with UI stuff in the VM.

To put it more simply, I want to ask the user if they need to save changes when the hit file close. I don't see how to do that in a VM without breaking MVVM rules.

Even using the examples seem to break MVVM rules. Passing a radpane to a command seems like it breaks MVVM rules.

Any insight would be greatly appreciated. (BTW, we are using prism). I am new to MVVM and right now, it seems very difficult to do simple stuff.

Thanks ... Ed

 

Randy Hompesch
Top achievements
Rank 1
 answered on 09 Nov 2016
3 answers
300 views

We have a data model which has the notion of "layers" where each layer has a collection of entities that I want to plot on the map. Each layer has properties to control layer visibility (and hence visibility of entities on that layer) on/off and also by zoom range (which differs for each layer). My thought is that I should be able to add a visualisation layer to the map control for each of the layers in my data model, but I can't see how to bind to a collection of layers. 

Is what I describe possible and/or the best approach to the problem I'm trying to solve?

Thanks.

 

 

Petar Mladenov
Telerik team
 answered on 08 Nov 2016
3 answers
139 views
I have a RadCartesianChart with a DateTimeContinuousAxis on the HorizontalAxis.  The data graphs exactly the way I want it, however I would like to display the way the horizontal AxisLabels display.  I would like them to display the total elapsed seconds from the minimum X value.  Is there some kind of template I could override?
Lance | Senior Manager Technical Support
Telerik team
 answered on 07 Nov 2016
5 answers
275 views
Hello everybody,

I try to synchronize the scroll into the gantView (the scroll into the panel which show event) with an other scrollViewer outside the ganttView.
the WrapPanel into scroll Viewer have the same size that event panel in the gantt, ant this panel contains month with same size thant month in the gantView (same number of month in my panel and month in the visible range in the gantt view, month represent by a rectangle and other thing ). The goal is to move scroll in one according to the other, to have the same months showing in the gantView and my panel.
fo this, I thinking suscribe to the event ScrollChanged in the two controls and work with HorizontalOffset in order to synchronize the two scroll, but I don't find this event in the ganttView.

Do you think what I try it's possible ?

Thanks,

Julien
Andrea
Top achievements
Rank 1
 answered on 07 Nov 2016
32 answers
770 views

Hi folks, I appreciate the help!

We used to use VisiBlox and there was a very helpful method called GetRenderPosition() and GetRealPosition() I think it was. 
This is helpful for converting a value such as 1000 (Hertz) into a screen position such as 123.456 (pixels) and back again.

Say I need to adjust a ScatterPointSeries by 10 pixels. I can't do this because there is no way to translate 10 pixels into X units on the HorizontalAxis. 

Specifically, this is impossible to do because I amusing a LogarithmicAxis for the X-Axis. So on the left side of the graph, 10 pixels on the screen corresponds to about 125Hz on my graph. On the right side of the graph, 10 pixels on screen corresponds to more like 2000Hz. 

Anyways, I found a method called RadChart.DefaultView.ChartArea.AxisX.ConvertPhysicalUnitsToData()
This looks like what I need, except for these problems:
-I am using RadCartesianChart not RadChart
-I tried hacking it together with a temporary RadChart variable and noticed that the AxisX property has no IsLogarithmic. 

So is there a method to do this? If not, that is incredibly disappointing. The VisiBlox method was so easy and helpful. 

Right now I have typed in dozens of data points and their approximate screen positions using screenshots of my pc, and then typing all these values into a Ti-83 graphing calculator and finding the best fit, and converting that function into c# code. It works, but now that the graph size has changed due to changes in my program, it is useless and there is no way to fix it again and make it future-proof. 

tl;dr - How, with RadCartesianChart, do I convert from a graph value to screen position and back again?

Nathanial
Top achievements
Rank 1
 answered on 07 Nov 2016
2 answers
135 views

InvalidOperationException: A style intended for type 'Telerik_Windows_Controls_RadTileViewItem_0_123599943' cannot be applied to type 'ContentPresenter'.

What is this supposed to mean?  This appears to pop up randomly, and now I cannot get it to go away..

Tyler
Top achievements
Rank 1
 answered on 07 Nov 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?