Telerik Forums
UI for WPF Forum
5 answers
735 views
I have a long header for my column, I want to allow the header to span more than one row. Essentially I want to be able Text Wrap the header. Setting: TextWrapping="Wrap", in GridViewDataColumn declaration doesn't appear to work.

Sorry the title of the post should be Multi Line Row Headers. Can't figure out a way to change the port title. Sorry for the confusion.
Dilyan Traykov
Telerik team
 answered on 12 Sep 2018
3 answers
160 views

I am using ChartView Telerik WPF Library. I want the points to get bigger when the user hovers over them. But for some reason it is not working as expected. The Ellipse gets bigger but it does not resize correctly. But I don't understand why. The other properties as border color and thickness are working correctly. Can someone tell me what am I missing here ?

This is how it looks currently(Look at the gif)

Here is the source code:

private FrameworkElementFactory AddPointsToSeries(KeyValuePair<ChartSerie, List<ChartDataPoint>> chartSeries, int colorPaletteIndex)
    {
        var seriesPredefinedColor = this.ChartBase.Palette.GlobalEntries[colorPaletteIndex].Fill;
 
        FrameworkElementFactory frameworkElement = new FrameworkElementFactory(typeof(Ellipse));
        frameworkElement.SetValue(Ellipse.FillProperty, ColorService.BrushFromHex(chartSeries.Key.ColorHex) ?? seriesPredefinedColor);
        frameworkElement.SetValue(Ellipse.HeightProperty, 9.0D);
        frameworkElement.SetValue(Ellipse.WidthProperty, 9.0D);
 
 
        frameworkElement.AddHandler(Ellipse.MouseEnterEvent, new MouseEventHandler((sender, args) =>
           {
               Ellipse ellipse = (Ellipse)sender;
               ellipse.Stroke = ColorService.BrushFromHex(ColorService.BlendHex((chartSeries.Key.ColorHex ?? ColorService.BrushToHex(seriesPredefinedColor)), "#000000", 0.4));
 
               // this is not correctly applied!
               ellipse.Width = 15;
               ellipse.Height = 15;
 
               ellipse.StrokeThickness = 2;
           }));
 
        frameworkElement.AddHandler(Ellipse.MouseLeaveEvent, new MouseEventHandler((sender, args) =>
           {
               Ellipse ellipse = (Ellipse)sender;
               ellipse.Height = 8;
               ellipse.Width  = 8;
 
               ellipse.Stroke = null;
           }));
 
 
        return frameworkElement;
    }
 
    // Here I create the Line Series and here I use the AddPointsToSeries Method
    private LineSeries CreateLineSeries(KeyValuePair<ChartSerie, List<ChartDataPoint>> chartSeries, ChartLegendSettings legendSettings,
                                        int colorPaletteIndex)
    {
        FrameworkElementFactory addPoints = AddPointsToSeries(chartSeries, colorPaletteIndex);
        var lineSerie = new LineSeries()
        {
            VerticalAxis    = CreateMultipleVerticalAxis(chartSeries, colorPaletteIndex, out var multipleVerticalAxis) ? multipleVerticalAxis : null,
            ZIndex          = 150, // the line series should always be displayed on top of other series.
            StrokeThickness = 3.5,
            LegendSettings  = (SeriesLegendSettings)legendSettings,
            Opacity         = 0.8,
            StackGroupKey = chartSeries.Key.Group,
            CombineMode   = string.IsNullOrEmpty(chartSeries.Key.Group) ? ChartSeriesCombineMode.None :
            ChartSeriesCombineMode.Stack,
 
            PointTemplate = new DataTemplate()
            {
                VisualTree = addPoints,
            },
        };
 
        // this is the color of line series
        if (chartSeries.Key.ColorHex != null)
        {
            lineSerie.Stroke = (SolidColorBrush)(new BrushConverter().ConvertFrom(chartSeries.Key.ColorHex));
        }
 
        foreach (ChartDataPoint serie in chartSeries.Value)
        {
            lineSerie.DataPoints.Add(new CategoricalDataPoint()
            {
                Category = serie.XPoint.Label,
                Value    = (double?)serie.Value,
            });
        }
 
        return lineSerie;
    }

 

Devid
Top achievements
Rank 1
 answered on 12 Sep 2018
6 answers
224 views

Hi,

The scrolling in the RADTileView control is not working out nicely, the offset on a single button click or mousewheel roll makes the page scroll more than needed.So assuming a page is displaying 25 lines a screen, after scrolling minimum it would be the 30th (i.e. not the 26 line) at the top. Thus the user would miss some content and would need to scroll back.

 

After going through the forums I have been able to fix this for the mousewheel using the code

private void ScrollViewer_MouseWheel(object sender, System.Windows.Input.MouseWheelEventArgs e)
{
    ScrollViewer scv = this.ctrlRadTileView.ChildrenOfType<ScrollViewer>().FirstOrDefault();
    scv.ScrollToVerticalOffset(scv.VerticalOffset - e.Delta);
    e.Handled = true;
}

However when the scrollbar buttons are clicked they still continue to have the wrong scroll effect. Is there any way to handle the scrollbar button clicked event or change the vertical offset property?

There is the ScrollViewer.ScrollInfo.VerticalOffset property but the scroll info object is not accessible.

Martin Ivanov
Telerik team
 answered on 11 Sep 2018
7 answers
347 views
How can I customize the Message List Part,  Its an ItemsPresenter , I want to change messages font and make the avatar little bigger. nothing is mentioned in the documentation for how to do this.
Omar
Top achievements
Rank 1
 answered on 11 Sep 2018
3 answers
70 views

In RadDock for WPF it is possible to set the DraggedElementVisualCue / DraggedElementVisualCueTemplate when using RadDocking.DragDropMode = Deferred. 

 

<ControlTemplate x:Key="DraggedElementVisualCueTemplate">
    <Grid Width="300" Height="200">
        <Border
            Margin="0 0 4 4"
            CornerRadius="1"
            BorderBrush="{TemplateBinding BorderBrush}"
            BorderThickness="{TemplateBinding BorderThickness}"
            Background="{TemplateBinding Background}" />
        <Border Margin="0 0 4 4" Padding="10">
            <TextBlock
                Text="{Binding Title}"
                Foreground="{StaticResource IconForegroundLight}"
                Margin="{TemplateBinding Padding}"
                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
        </Border>
    </Grid>
</ControlTemplate>
 
<docking:ObjectToTypeStringConverter x:Key="ObjectToTypeStringConverter"/>
 
<Style TargetType="telerik:DraggedElementVisualCue">
    <Setter Property="Foreground" Value="{StaticResource IconForegroundLight}"/>
    <Setter Property="BorderBrush" Value="{DynamicResource AccentColorBrush}"/>
    <Setter Property="Background" Value="{StaticResource HeaderBackgroundBrush}"/>
    <Setter Property="HorizontalContentAlignment" Value="Center"/>
    <Setter Property="VerticalContentAlignment" Value="Center"/>
    <Setter Property="BorderThickness" Value="2"/>
    <Setter Property="Margin" Value="10 0 0 0"/>
    <Setter Property="Padding" Value="6 2"/>
</Style>

 

So far so good :) 

What I'd like to do is to is have a different VisualCue template for certain pane types (e.g. depending on DataContext type, or Pane Type itself) 

Any ideas how? 

DraggedElementVisualCue.DataContext is of type DockingDragDropPayload. There is a Pane property in there but it's private ... so the data exists just not accessible. 

Martin
Telerik team
 answered on 10 Sep 2018
2 answers
74 views

Hi Telerik,

 

I'm using a RadDiagram and I want to change the behavior of the SettingsPane visibility.

Indeed, when the Zoom in the RadDiagram changed, the SettingsPane button visibility is changed to be hidden.

 

I try to implement this code :

<view:MirBuilderDiagram x:Name="myMirBuilderDiagram" Grid.Row="2" primitives:BackgroundGrid.IsGridVisible="False" primitives:BackgroundPageGrid.IsGridVisible="False" ActiveTool="{Binding ActiveTool, Mode=TwoWay}"
                        DataContext="{Binding Tag}" ItemsChanged="MirBuilderDiagram_ItemsChanged" ScrollViewer.HorizontalScrollBarVisibility="auto" ScrollViewer.VerticalScrollBarVisibility="auto"
                        SelectedItem="{Binding SelectedShape, Mode=OneWayToSource}" FontSize="9" Telerik:DiagramSurface.IsVirtualizing="False" SnapX="4" SnapY="4" ConnectionBridge="Bow" ConnectionStyle="{StaticResource RadDiagramConnectionStyle_RotateText}" CommandExecuted="myMirBuilderDiagram_CommandExecuted">
    <primitives:ItemInformationAdorner.AdditionalContent>
        <extensions:SettingsPane x:Name="mySettingPane" Diagram="{Binding ElementName=myMirBuilderDiagram}" Loaded="mySettingPane_Loaded" />
    </primitives:ItemInformationAdorner.AdditionalContent>
</view:MirBuilderDiagram>

 

Private Sub mySettingPane_Loaded(sender As Object, e As RoutedEventArgs)
    Dim settingPane As SettingsPane = TryCast(sender, SettingsPane)
 
    If settingPane IsNot Nothing Then
        Dim informationAdorner As ItemInformationAdorner = settingPane.ParentOfType(Of ItemInformationAdorner)()
        If informationAdorner IsNot Nothing Then
            AddHandler informationAdorner.IsAdditionalContentVisibleChanged, AddressOf InformationAdorner_IsAdditionalContentVisibleChanged
        End If
    End If
End Sub
 
Private Sub InformationAdorner_IsAdditionalContentVisibleChanged(ByVal sender As Object, ByVal e As EventArgs)
    Dim informationAdorner As ItemInformationAdorner = TryCast(sender, ItemInformationAdorner)
 
    If informationAdorner IsNot Nothing Then
        If Me.myMirBuilderDiagram.SelectedItem IsNot Nothing Then
            If Not informationAdorner.IsAdditionalContentVisible Then
                informationAdorner.IsAdditionalContentVisible = True
            End If
        End If
    End If
End Sub

 

The problem is at the bold line, because the "Setter is not accessible". I try to create an inherit class but the Setter is never accessible.

 

Do you know how I can keep the SettingsPane button visibility to Visible when the zoom changing (but keep the default behavior when SelectedItem changed, etc..) ?

Thank you.

Valentin
Top achievements
Rank 2
Iron
Iron
Iron
 answered on 10 Sep 2018
1 answer
954 views

COMException (OpenClipboard Failed (Exception from HRESULT: 0x800401D0 (CLIPBRD_E_CANT_OPEN))) in assembly mscorlib Void Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode IntPtr errorInfo)

My application is unable to catch this exception because it happens in the application message loop.

Can Telerik not handle this internally? Allowing the exception to continue up the call stack brings our application down.

Here is the Call Stack:

mscorlib Void Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode IntPtr errorInfo)
mscorlib Void Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode IntPtr errorInfo)
PresentationCore Void Windows.Clipboard.Flush()
Telerik.Windows.Controls.FixedDocumentViewers Void Telerik.Windows.Controls.FixedDocumentViewerBase. b__5(String s)
WindowsBase Object Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback Object args Int32 numArgs)
WindowsBase Object MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source Delegate method Object args Int32 numArgs Delegate catchHandler)
WindowsBase Void Windows.Threading.DispatcherOperation.InvokeImpl()
mscorlib Void Threading.ExecutionContext.RunInternal(Threading.ExecutionContext executionContext Threading.ContextCallback callback Object state Boolean preserveSyncCtx)
mscorlib Void Threading.ExecutionContext.Run(Threading.ExecutionContext executionContext Threading.ContextCallback callback Object state Boolean preserveSyncCtx)
mscorlib Void Threading.ExecutionContext.Run(Threading.ExecutionContext executionContext Threading.ContextCallback callback Object state)
WindowsBase Void Windows.Threading.DispatcherOperation.Invoke()
WindowsBase Void Windows.Threading.Dispatcher.ProcessQueue()
WindowsBase IntPtr Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd Int32 msg IntPtr wParam IntPtr lParam Boolean& handled)
WindowsBase IntPtr MS.Win32.HwndWrapper.WndProc(IntPtr hwnd Int32 msg IntPtr wParam IntPtr lParam Boolean& handled)
WindowsBase Object MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
WindowsBase Object Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback Object args Int32 numArgs)
WindowsBase Object MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source Delegate method Object args Int32 numArgs Delegate catchHandler)
WindowsBase Object Windows.Threading.Dispatcher.LegacyInvokeImpl(Windows.Threading.DispatcherPriority priority TimeSpan timeout Delegate method Object args Int32 numArgs)
WindowsBase IntPtr MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd Int32 msg IntPtr wParam IntPtr lParam)
Windows.Forms IntPtr Windows.Forms.UnsafeNativeMethods.DispatchMessageW(Windows.Forms.NativeMethods MSG& msg)
Windows.Forms Boolean Windows.Forms.Application ComponentManager.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID Int32 reason Int32 pvLoopData)
Windows.Forms Void Windows.Forms.Application ThreadContext.RunMessageLoopInner(Int32 reason Windows.Forms.ApplicationContext context)
Windows.Forms Void Windows.Forms.Application ThreadContext.RunMessageLoop(Int32 reason Windows.Forms.ApplicationContext context)
PacsViewer Void Novarad.Pacs.PacsViewer.App.Main(String args)

Boby
Telerik team
 answered on 10 Sep 2018
6 answers
193 views

Once I've started creating a new template using Expression Blend, The SuggestedActios Part disappears even using the default style created by Blend,

 

Kindly check the style 

 

<Style x:Key="RadChatStyle2" TargetType="{x:Type telerik:RadChat}">
    <Setter Property="FontFamily" Value="{telerik:Windows8Resource ResourceKey={x:Static telerik:Windows8ResourceKey.FontFamily}}"/>
    <Setter Property="Foreground" Value="{telerik:Windows8Resource ResourceKey={x:Static telerik:Windows8ResourceKey.MarkerBrush}}"/>
    <Setter Property="Background" Value="{telerik:Windows8Resource ResourceKey={x:Static telerik:Windows8ResourceKey.MainBrush}}"/>
    <Setter Property="BorderBrush" Value="{telerik:Windows8Resource ResourceKey={x:Static telerik:Windows8ResourceKey.BasicBrush}}"/>
    <Setter Property="BorderThickness" Value="1"/>
    <Setter Property="MessageListTemplateSelector">
    <Setter.Value>
    <ConversationalUI:MessageTemplateSelector>
    <ConversationalUI:MessageTemplateSelector.CalendarMessageTemplate>
    <DataTemplate>
    <telerik:RadCalendar DisplayDate="{Binding DisplayDate}" SelectedDate="{Binding SelectedDate, Mode=TwoWay}"/>
    </DataTemplate>
    </ConversationalUI:MessageTemplateSelector.CalendarMessageTemplate>
    <ConversationalUI:MessageTemplateSelector.CarouselTemplate>
    <DataTemplate>
    <ConversationalUI:CarouselCard/>
    </DataTemplate>
    </ConversationalUI:MessageTemplateSelector.CarouselTemplate>
    <ConversationalUI:MessageTemplateSelector.CardTemplate>
    <DataTemplate>
    <ConversationalUI:Card/>
    </DataTemplate>
    </ConversationalUI:MessageTemplateSelector.CardTemplate>
    <ConversationalUI:MessageTemplateSelector.DataFormTemplate>
    <DataTemplate>
    <ItemsControl Margin="5" MinWidth="220"/>
    </DataTemplate>
    </ConversationalUI:MessageTemplateSelector.DataFormTemplate>
    <ConversationalUI:MessageTemplateSelector.FlightCardTemplate>
    <DataTemplate>
    <ConversationalUI:FlightCard/>
    </DataTemplate>
    </ConversationalUI:MessageTemplateSelector.FlightCardTemplate>
    <ConversationalUI:MessageTemplateSelector.GifTemplate>
    <DataTemplate>
    <MediaElement Height="{Binding Size.Height}" LoadedBehavior="Play" Position="0" Source="{Binding Source}" Stretch="{Binding Stretch}" SpeedRatio="1" UnloadedBehavior="Play" Width="{Binding Size.Width}"/>
    </DataTemplate>
    </ConversationalUI:MessageTemplateSelector.GifTemplate>
    <ConversationalUI:MessageTemplateSelector.ImageCardTemplate>
    <DataTemplate>
    <ConversationalUI:ImageCard/>
    </DataTemplate>
    </ConversationalUI:MessageTemplateSelector.ImageCardTemplate>
    <ConversationalUI:MessageTemplateSelector.ImageTemplate>
    <DataTemplate>
    <Image Height="{Binding Size.Height}" Source="{Binding Source}" Stretch="{Binding Stretch}" Width="{Binding Size.Width}"/>
    </DataTemplate>
    </ConversationalUI:MessageTemplateSelector.ImageTemplate>
    <ConversationalUI:MessageTemplateSelector.ListMessageTemplate>
    <DataTemplate>
    <telerik:RadListBox DisplayMemberPath="{Binding DisplayMemberPath}" IsSynchronizedWithCurrentItem="False" IsTabStop="False" ItemTemplate="{Binding ItemTemplate}" IsTextSearchEnabled="True" MinWidth="220" SelectedIndex="{Binding SelectedIndex, Mode=TwoWay}" SelectedItem="{Binding SelectedItem, Mode=TwoWay}" SelectedValueBinding="{x:Null}" SelectionMode="{Binding SelectionMode}" TextBinding="{x:Null}"/>
    </DataTemplate>
    </ConversationalUI:MessageTemplateSelector.ListMessageTemplate>
    <ConversationalUI:MessageTemplateSelector.ProductCardTemplate>
    <DataTemplate>
    <ConversationalUI:ProductCard/>
    </DataTemplate>
    </ConversationalUI:MessageTemplateSelector.ProductCardTemplate>
    <ConversationalUI:MessageTemplateSelector.TextMessageTemplate>
    <DataTemplate>
    <ConversationalUI:TextMessageControl Stylus.IsFlicksEnabled="False" Stylus.IsPressAndHoldEnabled="False"/>
    </DataTemplate>
    </ConversationalUI:MessageTemplateSelector.TextMessageTemplate>
    <ConversationalUI:MessageTemplateSelector.WeatherCardTemplate>
    <DataTemplate>
    <ConversationalUI:WeatherCard/>
    </DataTemplate>
    </ConversationalUI:MessageTemplateSelector.WeatherCardTemplate>
    </ConversationalUI:MessageTemplateSelector>
    </Setter.Value>
    </Setter>
    <Setter Property="MessagePopupTemplateSelector">
    <Setter.Value>
    <ConversationalUI:MessageTemplateSelector>
    <ConversationalUI:MessageTemplateSelector.CalendarMessageTemplate>
    <DataTemplate>
    <telerik:RadCalendar DisplayDate="{Binding DisplayDate}" SelectedDate="{Binding SelectedDate, Mode=TwoWay}"/>
    </DataTemplate>
    </ConversationalUI:MessageTemplateSelector.CalendarMessageTemplate>
    <ConversationalUI:MessageTemplateSelector.CarouselTemplate>
    <DataTemplate>
    <ConversationalUI:CarouselCard/>
    </DataTemplate>
    </ConversationalUI:MessageTemplateSelector.CarouselTemplate>
    <ConversationalUI:MessageTemplateSelector.CardTemplate>
    <DataTemplate>
    <ConversationalUI:Card/>
    </DataTemplate>
    </ConversationalUI:MessageTemplateSelector.CardTemplate>
    <ConversationalUI:MessageTemplateSelector.DataFormTemplate>
    <DataTemplate>
    <ItemsControl Margin="5" MinWidth="220"/>
    </DataTemplate>
    </ConversationalUI:MessageTemplateSelector.DataFormTemplate>
    <ConversationalUI:MessageTemplateSelector.FlightCardTemplate>
    <DataTemplate>
    <ConversationalUI:FlightCard/>
    </DataTemplate>
    </ConversationalUI:MessageTemplateSelector.FlightCardTemplate>
    <ConversationalUI:MessageTemplateSelector.GifTemplate>
    <DataTemplate>
    <MediaElement Height="{Binding Size.Height}" LoadedBehavior="Play" Position="0" Source="{Binding Source}" Stretch="{Binding Stretch}" SpeedRatio="1" UnloadedBehavior="Play" Width="{Binding Size.Width}"/>
    </DataTemplate>
    </ConversationalUI:MessageTemplateSelector.GifTemplate>
    <ConversationalUI:MessageTemplateSelector.ImageCardTemplate>
    <DataTemplate>
    <ConversationalUI:ImageCard/>
    </DataTemplate>
    </ConversationalUI:MessageTemplateSelector.ImageCardTemplate>
    <ConversationalUI:MessageTemplateSelector.ImageTemplate>
    <DataTemplate>
    <Image Height="{Binding Size.Height}" Source="{Binding Source}" Stretch="{Binding Stretch}" Width="{Binding Size.Width}"/>
    </DataTemplate>
    </ConversationalUI:MessageTemplateSelector.ImageTemplate>
    <ConversationalUI:MessageTemplateSelector.ListMessageTemplate>
    <DataTemplate>
    <telerik:RadListBox DisplayMemberPath="{Binding DisplayMemberPath}" IsSynchronizedWithCurrentItem="False" IsTabStop="False" ItemTemplate="{Binding ItemTemplate}" IsTextSearchEnabled="True" MinWidth="220" SelectedIndex="{Binding SelectedIndex, Mode=TwoWay}" SelectedItem="{Binding SelectedItem, Mode=TwoWay}" SelectedValueBinding="{x:Null}" SelectionMode="{Binding SelectionMode}" TextBinding="{x:Null}"/>
    </DataTemplate>
    </ConversationalUI:MessageTemplateSelector.ListMessageTemplate>
    <ConversationalUI:MessageTemplateSelector.ProductCardTemplate>
    <DataTemplate>
    <ConversationalUI:ProductCard/>
    </DataTemplate>
    </ConversationalUI:MessageTemplateSelector.ProductCardTemplate>
    <ConversationalUI:MessageTemplateSelector.TextMessageTemplate>
    <DataTemplate>
    <ConversationalUI:TextMessageControl Stylus.IsFlicksEnabled="False" Stylus.IsPressAndHoldEnabled="False"/>
    </DataTemplate>
    </ConversationalUI:MessageTemplateSelector.TextMessageTemplate>
    <ConversationalUI:MessageTemplateSelector.WeatherCardTemplate>
    <DataTemplate>
    <ConversationalUI:WeatherCard/>
    </DataTemplate>
    </ConversationalUI:MessageTemplateSelector.WeatherCardTemplate>
    </ConversationalUI:MessageTemplateSelector>
    </Setter.Value>
    </Setter>
    <Setter Property="MessageOverlayTemplateSelector">
    <Setter.Value>
    <ConversationalUI:MessageTemplateSelector>
    <ConversationalUI:MessageTemplateSelector.CalendarMessageTemplate>
    <DataTemplate>
    <telerik:RadCalendar DisplayDate="{Binding DisplayDate}" SelectedDate="{Binding SelectedDate, Mode=TwoWay}"/>
    </DataTemplate>
    </ConversationalUI:MessageTemplateSelector.CalendarMessageTemplate>
    <ConversationalUI:MessageTemplateSelector.CarouselTemplate>
    <DataTemplate>
    <ConversationalUI:CarouselCard/>
    </DataTemplate>
    </ConversationalUI:MessageTemplateSelector.CarouselTemplate>
    <ConversationalUI:MessageTemplateSelector.CardTemplate>
    <DataTemplate>
    <ConversationalUI:Card/>
    </DataTemplate>
    </ConversationalUI:MessageTemplateSelector.CardTemplate>
    <ConversationalUI:MessageTemplateSelector.DataFormTemplate>
    <DataTemplate>
    <ItemsControl Margin="5" MinWidth="220"/>
    </DataTemplate>
    </ConversationalUI:MessageTemplateSelector.DataFormTemplate>
    <ConversationalUI:MessageTemplateSelector.FlightCardTemplate>
    <DataTemplate>
    <ConversationalUI:FlightCard/>
    </DataTemplate>
    </ConversationalUI:MessageTemplateSelector.FlightCardTemplate>
    <ConversationalUI:MessageTemplateSelector.GifTemplate>
    <DataTemplate>
    <MediaElement Height="{Binding Size.Height}" LoadedBehavior="Play" Position="0" Source="{Binding Source}" Stretch="{Binding Stretch}" SpeedRatio="1" UnloadedBehavior="Play" Width="{Binding Size.Width}"/>
    </DataTemplate>
    </ConversationalUI:MessageTemplateSelector.GifTemplate>
    <ConversationalUI:MessageTemplateSelector.ImageCardTemplate>
    <DataTemplate>
    <ConversationalUI:ImageCard/>
    </DataTemplate>
    </ConversationalUI:MessageTemplateSelector.ImageCardTemplate>
    <ConversationalUI:MessageTemplateSelector.ImageTemplate>
    <DataTemplate>
    <Image Height="{Binding Size.Height}" Source="{Binding Source}" Stretch="{Binding Stretch}" Width="{Binding Size.Width}"/>
    </DataTemplate>
    </ConversationalUI:MessageTemplateSelector.ImageTemplate>
    <ConversationalUI:MessageTemplateSelector.ListMessageTemplate>
    <DataTemplate>
    <telerik:RadListBox DisplayMemberPath="{Binding DisplayMemberPath}" IsSynchronizedWithCurrentItem="False" IsTabStop="False" ItemTemplate="{Binding ItemTemplate}" IsTextSearchEnabled="True" MinWidth="220" SelectedIndex="{Binding SelectedIndex, Mode=TwoWay}" SelectedItem="{Binding SelectedItem, Mode=TwoWay}" SelectedValueBinding="{x:Null}" SelectionMode="{Binding SelectionMode}" TextBinding="{x:Null}"/>
    </DataTemplate>
    </ConversationalUI:MessageTemplateSelector.ListMessageTemplate>
    <ConversationalUI:MessageTemplateSelector.ProductCardTemplate>
    <DataTemplate>
    <ConversationalUI:ProductCard/>
    </DataTemplate>
    </ConversationalUI:MessageTemplateSelector.ProductCardTemplate>
    <ConversationalUI:MessageTemplateSelector.TextMessageTemplate>
    <DataTemplate>
    <ConversationalUI:TextMessageControl Stylus.IsFlicksEnabled="False" Stylus.IsPressAndHoldEnabled="False"/>
    </DataTemplate>
    </ConversationalUI:MessageTemplateSelector.TextMessageTemplate>
    <ConversationalUI:MessageTemplateSelector.WeatherCardTemplate>
    <DataTemplate>
    <ConversationalUI:WeatherCard/>
    </DataTemplate>
    </ConversationalUI:MessageTemplateSelector.WeatherCardTemplate>
    </ConversationalUI:MessageTemplateSelector>
    </Setter.Value>
    </Setter>
    <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
    <Setter Property="IsTabStop" Value="False"/>
    <Setter Property="Template">
    <Setter.Value>
    <ControlTemplate TargetType="{x:Type telerik:RadChat}">
    <Grid>
    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
    <Grid>
    <Grid.RowDefinitions>
    <RowDefinition/>
    <RowDefinition Height="Auto"/>
    <RowDefinition Height="Auto"/>
    <RowDefinition Height="Auto"/>
    <RowDefinition Height="48"/>
    <RowDefinition Height="Auto"/>
    </Grid.RowDefinitions>
    <ConversationalUI:ChatMessageList x:Name="PART_MessageList" Margin="{TemplateBinding Padding}" Grid.Row="0"/>
    <ConversationalUI:ChatPopupPlaceholder x:Name="PART_PopupPlaceholder" BorderBrush="{TemplateBinding BorderBrush}" Grid.Row="1" Visibility="Collapsed"/>
    <ItemsControl x:Name="PART_SuggestionItemsControl" Stylus.IsFlicksEnabled="False" Stylus.IsPressAndHoldEnabled="False" ConversationalUI:ScrollViewerScrollingHelper.IsEnabled="True" Padding="12,16,5,12" Grid.Row="2" Visibility="{Binding SuggestedActionsVisibility, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type telerik:RadChat}}}">
    <ItemsControl.ItemsPanel>
    <ItemsPanelTemplate>
    <VirtualizingStackPanel IsItemsHost="True" Orientation="Horizontal"/>
    </ItemsPanelTemplate>
    </ItemsControl.ItemsPanel>
    <ItemsControl.ItemTemplate>
    <DataTemplate>
    <telerik:RadButton BorderBrush="{DynamicResource {x:Static telerik:Windows8ResourceKey.AccentBrush}}" BorderThickness="2" Background="{DynamicResource {x:Static telerik:Windows8ResourceKey.AccentBrush}}" CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type telerik:RadChat}}}" Command="{Binding Command}" Foreground="{DynamicResource {x:Static telerik:Windows8ResourceKey.MainBrush}}" Stylus.IsFlicksEnabled="False" InnerCornerRadius="0" Stylus.IsPressAndHoldEnabled="False" Margin="0,0,10,0" MinHeight="28" telerik:TouchManager.ShouldSuspendMousePromotion="True">
    <StackPanel Orientation="Horizontal">
    <Image Height="16" Source="{Binding Icon}" Stretch="UniformToFill" Width="16">
    <Image.Clip>
    <EllipseGeometry Center="8,8" RadiusY="8" RadiusX="8"/>
    </Image.Clip>
    <Image.Visibility>
    <Binding Path="Source" RelativeSource="{RelativeSource Self}">
    <Binding.Converter>
    <telerik:NullToVisibilityConverter/>
    </Binding.Converter>
    </Binding>
    </Image.Visibility>
    </Image>
    <TextBlock Margin="{Binding Padding, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type telerik:RadButton}}}" Text="{Binding Text}" VerticalAlignment="Center">
    <TextBlock.Visibility>
    <Binding Path="Text" RelativeSource="{RelativeSource Self}">
    <Binding.Converter>
    <telerik:NullToVisibilityConverter/>
    </Binding.Converter>
    </Binding>
    </TextBlock.Visibility>
    </TextBlock>
    </StackPanel>
    </telerik:RadButton>
    </DataTemplate>
    </ItemsControl.ItemTemplate>
    <ItemsControl.Template>
    <ControlTemplate TargetType="{x:Type ItemsControl}">
    <ScrollViewer BorderThickness="0" Background="{x:Null}" HorizontalScrollBarVisibility="Auto">
    <ScrollViewer.Style>
    <Style TargetType="{x:Type ScrollViewer}">
    <Setter Property="Template">
    <Setter.Value>
    <ControlTemplate TargetType="{x:Type ScrollViewer}">
    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
    <Grid>
    <ScrollContentPresenter x:Name="PART_ScrollContentPresenter" CanContentScroll="{TemplateBinding CanContentScroll}" CanHorizontallyScroll="False" CanVerticallyScroll="False" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Margin="{TemplateBinding Padding}"/>
    <ScrollBar x:Name="PART_VerticalScrollBar" AutomationProperties.AutomationId="VerticalScrollBar" Cursor="Arrow" HorizontalAlignment="Right" Maximum="{TemplateBinding ScrollableHeight}" Minimum="0" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportHeight}"/>
    <ScrollBar x:Name="PART_HorizontalScrollBar" AutomationProperties.AutomationId="HorizontalScrollBar" Cursor="Arrow" Maximum="{TemplateBinding ScrollableWidth}" Minimum="0" Orientation="Horizontal" telerik:TouchManager.TouchMode="None" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportWidth}" VerticalAlignment="Bottom"/>
    </Grid>
    </Border>
    </ControlTemplate>
    </Setter.Value>
    </Setter>
    <Style.BasedOn>
    <Style TargetType="{x:Type ScrollViewer}">
    <Setter Property="Template">
    <Setter.Value>
    <ControlTemplate TargetType="{x:Type ScrollViewer}">
    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
    <Grid>
    <Grid.ColumnDefinitions>
    <ColumnDefinition Width="*"/>
    <ColumnDefinition Width="Auto"/>
    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
    <RowDefinition Height="*"/>
    <RowDefinition Height="Auto"/>
    </Grid.RowDefinitions>
    <ScrollContentPresenter x:Name="PART_ScrollContentPresenter" CanContentScroll="{TemplateBinding CanContentScroll}" CanHorizontallyScroll="False" CanVerticallyScroll="False" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Grid.Column="0" Margin="{TemplateBinding Padding}" Grid.Row="0"/>
    <ScrollBar x:Name="PART_VerticalScrollBar" AutomationProperties.AutomationId="VerticalScrollBar" Cursor="Arrow" Grid.Column="1" Maximum="{TemplateBinding ScrollableHeight}" Minimum="0" Grid.Row="0" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportHeight}"/>
    <ScrollBar x:Name="PART_HorizontalScrollBar" AutomationProperties.AutomationId="HorizontalScrollBar" Cursor="Arrow" Grid.Column="0" Maximum="{TemplateBinding ScrollableWidth}" Minimum="0" Orientation="Horizontal" Grid.Row="1" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportWidth}"/>
    </Grid>
    </Border>
    </ControlTemplate>
    </Setter.Value>
    </Setter>
    <Setter Property="Background" Value="{telerik:Windows8Resource ResourceKey={x:Static telerik:Windows8ResourceKey.MainBrush}}"/>
    <Setter Property="BorderBrush" Value="{telerik:Windows8Resource ResourceKey={x:Static telerik:Windows8ResourceKey.BasicBrush}}"/>
    <Setter Property="BorderThickness" Value="1"/>
    <Setter Property="VerticalScrollBarVisibility" Value="Auto"/>
    <Setter Property="HorizontalScrollBarVisibility" Value="Auto"/>
    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
    <Setter Property="VerticalContentAlignment" Value="Stretch"/>
    <Setter Property="IsTabStop" Value="False"/>
    <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
    </Style>
    </Style.BasedOn>
    </Style>
    </ScrollViewer.Style>
    <ItemsPresenter Margin="{TemplateBinding Padding}"/>
    </ScrollViewer>
    </ControlTemplate>
    </ItemsControl.Template>
    </ItemsControl>
    <ConversationalUI:TypingIndicator x:Name="PART_TypingIndicator" Icon="{TemplateBinding TypingIndicatorIcon}" Grid.Row="3" Text="{TemplateBinding TypingIndicatorText}" Visibility="{TemplateBinding TypingIndicatorVisibility}"/>
    <Border x:Name="InputBoxContainer" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0,1,0,0" Grid.Row="4">
    <DockPanel>
    <StackPanel DockPanel.Dock="Right" Orientation="Horizontal">
    <telerik:RadToggleButton x:Name="PART_ToolBarButton" IsChecked="{Binding IsToolBarOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" InnerCornerRadius="0" Margin="5,0">
    <telerik:RadToggleButton.Style>
    <Style TargetType="{x:Type telerik:RadToggleButton}">
    <Setter Property="Height" Value="28"/>
    <Setter Property="Width" Value="28"/>
    <Setter Property="Padding" Value="0"/>
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="BorderThickness" Value="0"/>
    <Setter Property="Foreground" Value="{telerik:Windows8Resource ResourceKey={x:Static telerik:Windows8ResourceKey.StrongBrush}}"/>
    <Setter Property="VerticalAlignment" Value="Center"/>
    <Setter Property="HorizontalContentAlignment" Value="Center"/>
    <Setter Property="VerticalContentAlignment" Value="Center"/>
    <Setter Property="IsTabStop" Value="False"/>
    <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
    <Setter Property="UseLayoutRounding" Value="True"/>
    <Setter Property="Template">
    <Setter.Value>
    <ControlTemplate TargetType="{x:Type telerik:RadToggleButton}">
    <Grid>
    <Border x:Name="BorderVisual" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}"/>
    <ContentPresenter x:Name="Content" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" TextElement.Foreground="{TemplateBinding Foreground}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
    </Grid>
    <ControlTemplate.Triggers>
    <Trigger Property="IsChecked" Value="True">
    <Setter Property="Foreground" Value="{telerik:Windows8Resource ResourceKey={x:Static telerik:Windows8ResourceKey.AccentBrush}}"/>
    </Trigger>
    <Trigger Property="IsMouseOver" Value="True">
    <Setter Property="Foreground" Value="{telerik:Windows8Resource ResourceKey={x:Static telerik:Windows8ResourceKey.MarkerBrush}}"/>
    </Trigger>
    <Trigger Property="IsPressed" Value="True">
    <Setter Property="Foreground" Value="{telerik:Windows8Resource ResourceKey={x:Static telerik:Windows8ResourceKey.MarkerBrush}}"/>
    </Trigger>
    <Trigger Property="IsEnabled" Value="False">
    <Setter Property="Opacity" TargetName="Content" Value="0.3"/>
    </Trigger>
    </ControlTemplate.Triggers>
    </ControlTemplate>
    </Setter.Value>
    </Setter>
    </Style>
    </telerik:RadToggleButton.Style>
    <telerik:RadToggleButton.Visibility>
    <Binding Path="ToolBarCommands.Count" RelativeSource="{RelativeSource TemplatedParent}">
    <Binding.Converter>
    <telerik:NumberToVisibilityConverter/>
    </Binding.Converter>
    </Binding>
    </telerik:RadToggleButton.Visibility>
    <telerik:RadGlyph Glyph="" TextOptions.TextRenderingMode="Aliased"/>
    </telerik:RadToggleButton>
    <telerik:RadButton x:Name="SendButton" CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding SendCommand, RelativeSource={RelativeSource TemplatedParent}}" InnerCornerRadius="0" Margin="5,0">
    <telerik:RadButton.Style>
    <Style TargetType="{x:Type telerik:RadButton}">
    <Setter Property="Height" Value="28"/>
    <Setter Property="Width" Value="28"/>
    <Setter Property="Padding" Value="0"/>
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="BorderThickness" Value="0"/>
    <Setter Property="Foreground" Value="{telerik:Windows8Resource ResourceKey={x:Static telerik:Windows8ResourceKey.AccentBrush}}"/>
    <Setter Property="VerticalAlignment" Value="Center"/>
    <Setter Property="HorizontalContentAlignment" Value="Center"/>
    <Setter Property="VerticalContentAlignment" Value="Center"/>
    <Setter Property="IsTabStop" Value="False"/>
    <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
    <Setter Property="UseLayoutRounding" Value="True"/>
    <Setter Property="Template">
    <Setter.Value>
    <ControlTemplate TargetType="{x:Type telerik:RadButton}">
    <Grid>
    <Border x:Name="BorderVisual" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}"/>
    <ContentPresenter x:Name="Content" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" TextElement.Foreground="{TemplateBinding Foreground}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
    </Grid>
    <ControlTemplate.Triggers>
    <Trigger Property="IsMouseOver" Value="True">
    <Setter Property="Foreground" Value="{telerik:Windows8Resource ResourceKey={x:Static telerik:Windows8ResourceKey.MarkerBrush}}"/>
    </Trigger>
    <Trigger Property="IsPressed" Value="True">
    <Setter Property="Foreground" Value="{telerik:Windows8Resource ResourceKey={x:Static telerik:Windows8ResourceKey.MarkerBrush}}"/>
    </Trigger>
    <Trigger Property="IsEnabled" Value="False">
    <Setter Property="Opacity" TargetName="Content" Value="0.3"/>
    </Trigger>
    </ControlTemplate.Triggers>
    </ControlTemplate>
    </Setter.Value>
    </Setter>
    </Style>
    </telerik:RadButton.Style>
    <Path Data="M1,9L18,9 0,16z M0,0L18,8 1,8z" Fill="{Binding Foreground, ElementName=SendButton}" Stretch="None" SnapsToDevicePixels="True" StrokeThickness="0"/>
    </telerik:RadButton>
    </StackPanel>
    <telerik:RadWatermarkTextBox x:Name="PART_InputBox" AcceptsReturn="True" BorderThickness="0" Background="Transparent" WatermarkContent="{TemplateBinding InputBoxWatermarkContent}"/>
    </DockPanel>
    </Border>
    <Border x:Name="PART_ToolBar" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0,1,0,0" Background="{DynamicResource {x:Static telerik:Windows8ResourceKey.MainBrush}}" CornerRadius="0,0,1,1" Height="48" Grid.Row="5" SnapsToDevicePixels="True">
    <Border.Visibility>
    <Binding ElementName="PART_ToolBarButton" Path="IsChecked">
    <Binding.Converter>
    <telerik:BooleanToVisibilityConverter/>
    </Binding.Converter>
    </Binding>
    </Border.Visibility>
    <ItemsControl>
    <ItemsControl.ItemsPanel>
    <ItemsPanelTemplate>
    <StackPanel IsItemsHost="True" Orientation="Horizontal"/>
    </ItemsPanelTemplate>
    </ItemsControl.ItemsPanel>
    <ItemsControl.ItemTemplate>
    <DataTemplate>
    <telerik:RadButton ContentTemplate="{Binding ToolBarCommandTemplate, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type telerik:RadChat}}}" Content="{Binding}" Command="{Binding Command}" InnerCornerRadius="0" Margin="5,5,0,5"/>
    </DataTemplate>
    </ItemsControl.ItemTemplate>
    </ItemsControl>
    </Border>
    <ConversationalUI:ChatOverlay x:Name="PART_Overlay" Grid.RowSpan="5" Visibility="Collapsed"/>
    </Grid>
    </Border>
    </Grid>
    </ControlTemplate>
    </Setter.Value>
    </Setter>
    </Style>

 

Omar
Top achievements
Rank 1
 answered on 09 Sep 2018
7 answers
560 views

I could not find a answer to this Question in the documentation nor the forum so I am asking here:

Right now, all references get stored in [SOLUTIONDIRECTORY]\lib\RCWPF\...

Is there any way of changing this path, for example via a config file like nuget offers?

This is causing us some trouble since we allready established a certain folderarchitecture and would like to incoorporate all references from telerik without using scripts to copy stuff arround. 

If the Forum is the wrong place to ask, should I open a ticket or a feature request?

dew
Top achievements
Rank 1
 answered on 08 Sep 2018
1 answer
658 views

So, I went out and specifically bought Telerik UI for WPF because we needed a good PDF Viewer.

My structure is rather simple

WPF:

<Window
        xmlns:local="clr-namespace:Catalogo"
        xmlns:controls="clr-namespace:Controls;assembly=Controls"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" x:Class="Catalogo.Catalogos"
        mc:Ignorable="d"
        Title="Catalogo" WindowStartupLocation="CenterScreen" SnapsToDevicePixels="False"
        VisualEdgeMode="Aliased"
        ResizeMode="NoResize"
        Height="{DynamicResource {x:Static SystemParameters.MaximizedPrimaryScreenHeightKey}}"
        Width="{DynamicResource {x:Static SystemParameters.MaximizedPrimaryScreenWidthKey}}" WindowStyle="None"
        Loaded="Window_Loaded" Background="{DynamicResource primary_dark}">
    <Window.Resources>
        <ResourceDictionary Source="/Styles;component/Merged.xaml"/>
    </Window.Resources>
    <Grid>
        <telerik:RadBook RightPageIndex="1" BorderBrush="Transparent" >
            <telerik:RadBookItem Width="960" Height="1060" >
                <Grid>
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <telerik:RadPdfViewerToolBar RadPdfViewer="{Binding ElementName=pdfViewerIzq, Mode=OneTime}"/>
                        <telerik:RadPdfViewer x:Name="pdfViewerIzq" DataContext="{Binding CommandDescriptors, ElementName=pdfViewerIzq}" Grid.Row="1"/>
                    </Grid>
 
                </Grid>
            </telerik:RadBookItem>
            <telerik:RadBookItem  Width="960" Height="1060">
 
                <Grid>
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <telerik:RadPdfViewerToolBar Name="barraDer" RadPdfViewer="{Binding ElementName=pdfViewerDer, Mode=OneTime}"/>
                        <telerik:RadPdfViewer x:Name="pdfViewerDer" DataContext="{Binding CommandDescriptors, ElementName=pdfViewerDer}" Grid.Row="1"/>
                    </Grid>
 
                </Grid>
            </telerik:RadBookItem>
        </telerik:RadBook>
    </Grid>
</Window>

 

Then I have two methods for setting the source for the left and right viewers:

public void setPageIzq(string ruta)
        {
            pdfViewerIzq.DocumentSource = new PdfDocumentSource(new System.Uri(ruta));
            pdfViewerIzq.FitToPage();
            pdfViewerIzq.Mode = Telerik.Windows.Documents.Fixed.UI.FixedDocumentViewerMode.TextSelection;
            pdfViewerIzq.CommandDescriptors.FitToPageFixedDocumentSinglePageViewPresenterCommandDescriptor.IsEnabled = true;
            pdfViewerIzq.CommandDescriptors.FitToPageFixedDocumentSinglePageViewPresenterCommandDescriptor.Command.Execute(null);
            pdfViewerIzq.ScaleMode = Telerik.Windows.Documents.Fixed.UI.ScaleMode.FitToPage;
        }
 
        public void setPageDer(string ruta)
        {
            pdfViewerDer.DocumentSource = new PdfDocumentSource(new System.Uri(ruta));
            pdfViewerIzq.CommandDescriptors.FitToPageCommandDescriptor.IsEnabled = true;
            pdfViewerIzq.CommandDescriptors.FitToPageCommandDescriptor.Command.Execute(null);
        }

 

 

As you can see, I tried a bunch of different ways to set the viewer to fit to page. If I use the navbar up top, I can make it fit to page, but none of the methods I tried worked for my manual setting.

 

I had to take this approach because we need to display the document two pages at a time, any good ideas?

Anna
Telerik team
 answered on 07 Sep 2018
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
Slider
Expander
TileList
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
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
WebCam
CardView
DataBar
Licensing
FilePathPicker
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
VirtualKeyboard
HighlightTextBlock
Security
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?