Telerik Forums
UI for WPF Forum
2 answers
1.8K+ views
Hello,

We have a control that contains a RadCarousel that gets it's DataContext/ItemSource set to a View Model property which is an ObservableCollection<Tool> of custom "Tools" objects.  That object has a Name property and an Image property.  In it's previous life in a generic legacy WPF solution the control data bound the icon/image to display using an "ImagePath" data member.  This worked fine because the control was able to access images set to Resource as the build type and located in a /Resources folder.

The current project is a Prism 4 solution and contains multiple modules.  Each module is loaded dynamically from a folder at runtime using the DirectoryModuleCatalog class.  This is all working fine and each module injects it's own RibbonGroup into a RadRibbonView,  The Home RibbonGroup contains this RadCarousel control mentioned above.  Each module injects it's own "Tool" into the hosted view model using an event.  This is working fine in that the RadCarousel is displaying the tools but is currently only displaying a name property.  The DataTemplate binds the "Name" and "Image" data members but again the image is not showing.

The Tool class has an "ImageTool" property (of type System.Drawing.Image)  that is filled by the Module classes before the Home Ribbon shows.  So by the time the Home Ribbon view shows it has a valid ItemSource filled with these Tool objects and their respective ToolImages property containing an instantiated image.  I felt it had to be done this way because the "ImagePath" design or property in it's previous life is now obsolete in that there cannot be a static path pointed to in this Prism paradigm where the host project is loading these modules dynamically and from a folder.

Here is the DataTemplate code that is working but not showing an image ..


<DataTemplate x:Key="customItemTemplate">
                <Grid HorizontalAlignment="Center">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>                    
                    <Image  Source="{Binding ToolIimage}" Width="25" Height="25" Grid.Row="0"/>
                    <TextBlock Text="{Binding Name}" Grid.Row="1" />
                </Grid>
            </DataTemplate>

Can someone offer a suggestion as to how to get an image displaying for each item in the Carousel from an instantiated image?

Thank you,

Reid


Reid
Top achievements
Rank 2
 answered on 23 Jun 2014
7 answers
417 views
I can't figure out how to add the contents of a RadDocument (with styling) to a table cell when exporting to PDF. Any advice on how I should go about solving this?

        private void RadButton_Click(object sender, RoutedEventArgs e)
        {
            var span = new Span();
            span.Text = "Span1";
            var paragraph = new Paragraph();
            paragraph.Inlines.Add(span);
            var tableCell1 = new TableCell();
            tableCell1.Blocks.Add(paragraph);
            
            var tableCell2 = new TableCell();
            tableCell2.Blocks.Add(Editor.Document); // THIS WON'T COMPILE, BUT HOW TO FIX?

            var tableRow = new TableRow();
            tableRow.Cells.Add(tableCell1);
            tableRow.Cells.Add(tableCell2);

            var table = new Table();
            table.AddRow(tableRow);

            var section = new Section();
            section.Blocks.Add(table);

            var document = new RadDocument();
            document.Sections.Add(section);

            var saveFileDialog = new SaveFileDialog();
            saveFileDialog.DefaultExt = ".pdf";
            saveFileDialog.Filter = "Portable Document Format (*.pdf) | *.pdf";

            var result = saveFileDialog.ShowDialog();

            if (result == true)
            {
                using (var saveFileStream = saveFileDialog.OpenFile())
                {
                    var provider = new PdfFormatProvider();

                    provider.Export(document, saveFileStream);
                }
            }
        }
Petya
Telerik team
 answered on 23 Jun 2014
1 answer
155 views
I've test telerik control for example ListBox and GridView when the content get scroll these warning came out, just curious what this mean for why it is thrown, no storyboard I've created or modified yet, the only changes the default theme to Window8Touch ?
Any idea to get rid of this thanks.

System.Windows.Media.Animation Warning: 6 : Unable to perform action because the specified Storyboard was never applied to this object for interactive control.; Action='Remove'; Storyboard='System.Windows.Media.Animation.Storyboard'; Storyboard.HashCode='34280961'; Storyboard.Type='System.Windows.Media.Animation.Storyboard'; TargetElement='System.Windows.Media.Animation.Storyboard'; TargetElement.HashCode='34280961'; TargetElement.Type='System.Windows.Media.Animation.Storyboard'
Lance | Senior Manager Technical Support
Telerik team
 answered on 23 Jun 2014
5 answers
879 views
Hi,
Does anyone know if there is a way to disable the dropdown calendar of the DateTimePicker?
I would still like to be able to enter the date in the text area.

Thanks

Alek
Telerik team
 answered on 23 Jun 2014
1 answer
73 views
Hi,
I have problem with Carousel Items. I have grid with RadCarousel control and I would like to rise Carousel Items. Everything is shown on image. Could you tell me where I can change Items position?
My cod:
 <telerik:RadCarousel 
                             x:Name="sampleRadCarousel"
                            Background="Transparent"
                             ItemsSource="{Binding CarouselCollection}"
                             HorizontalAlignment="Center" 
                             AllowDrop="True"
                             Panel.ZIndex="4" 
                             Grid.Column="1"
                             HorizontalScrollBarVisibility="Disabled"
                            
                             carouselDragDrop:CarouselDragDropBehavior.IsEnabled="True">
                    <telerik:RadCarousel.ItemsPanel>
                        <ItemsPanelTemplate>
                            <telerik:RadCarouselPanel HorizontalAlignment="Center" VerticalAlignment="Top" IsItemsHost="True" />
                        </ItemsPanelTemplate>
                    </telerik:RadCarousel.ItemsPanel>
                    <telerik:RadCarousel.ItemTemplate>
                        <DataTemplate>
                            <telerik:Tile TileType="Single" Height="120" Width="150">
                                <Grid >
                                    <TextBlock Text="Travel"/>
                                </Grid>
                            </telerik:Tile>
                        </DataTemplate>
                    </telerik:RadCarousel.ItemTemplate>
                </telerik:RadCarousel>
Przemysław
Top achievements
Rank 1
 answered on 22 Jun 2014
2 answers
297 views
I want to click RadPane to show and hide RadPane. Like Visual Studio does. (No auto show and hide when MouseEnter)
Please watch this picture
Ye HaoChen
Top achievements
Rank 1
 answered on 21 Jun 2014
7 answers
255 views

Hi,

When applying implicit styles almost all controls seem to have white characters with a black background, except for the Datafilter.

when adding a filter, you can click a dropdown, and the values in the dropdown are correct in white color, but once selected the color of the characters are black and the background is black.

Erdem
Top achievements
Rank 1
 answered on 20 Jun 2014
6 answers
171 views
Hello,

I try to use the RadScheduleViewCommands.DeleteAppointment in a MVVM pattern in my XAML, like this :

                <Button Name="DeleteButton" Margin="5"
                        Content="{x:Static loc:Locals.activity_create_window_delete_btn}"
                        IsEnabled="{Binding CanDeleteAppointment}"
                        Command="telerik:RadScheduleViewCommands.DeleteAppointment">

But this doesn't seem to work, as the button is always disabled. I even tried using IsEnabled="True", but it remains the same.

Is this a bug, or is there anything I do wrong ?

Thanks for help.

Boris
Kalin
Telerik team
 answered on 20 Jun 2014
2 answers
97 views
Is there a way to have different RadMap backgrounds for different zoom levels?   I have an application that uses a high-level map for a facility.  When I zoom in to a certain level I would like to switch to a more detailed image background.  I would need the RadMap to behave as follows:

* for zoom levels 20-15, use URI #1 as the background image.
* for zoom levels 15 and lower, use URI #2 as the background image.

  What is the best way to achieve this bahavior?
Andrey
Telerik team
 answered on 20 Jun 2014
8 answers
244 views
I am struggling on what event to subscribe to and how to design a project based around the outlook bar and prism.

So far I have the main shell with 2 regions: One which holds the OutlookBar  and ...

the Main Region

I have modules which include Views for the outlookbar; The view is a RadOutlookBarItem
and views for the main region.

The Outlook Views all load correctly, but I am at a loss as to how to "wireup" these such that when the outlookbar items are selected the appropriate view is displayed in the Main Region.

I'm guessing the ViewModel for the main program should do something like (from the samples)

RadOutlookBarItem newSelectedItem = (sender as RadOutlookBar).SelectedItem as RadOutlookBarItem;

then call something on this which is translated back within the OutlookBarItems View Model??

like newSelecteditem.IsSelected = true; ???

Then I'm not really sure of the code to display that view (which was previously registered with the "MainRegion"?)

any help either links or gentle pushes greatly appreciated

TIA
Michael

Brew Hutch
Top achievements
Rank 1
 answered on 20 Jun 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?