Telerik Forums
UI for WPF Forum
0 answers
64 views

In my code I have a implemented method which in some cases can append new text for existing archive entry. But when I tried this code it gives me a System.ArgumentException: 'An item with the same key has already been added. Key: dir/file.csv'. This exception occurs in situations when given entryName will be something like this 'dir//file.csv''.  This small difference does not allow archive.GetEntry(entryName) return something else then null.

public void Insert(Stream stream, string entryName, bool append = false)
{
    using var baseStream = FileSystem.FileStream.New(ArchivePath, FileMode.Open, FileAccess.ReadWrite);
    using var archive = new ZipArchive(baseStream, ZipArchiveMode.Update, false, null, compressionSettings, encryptionSettings);

    var entry = archive.GetEntry(entryName); // null
    var entryStream = append
        ? entry?.Open() ?? archive.CreateEntry(entryName).Open() //exception cause already exists
        : archive.CreateEntry(entryName).Open(); 
    stream.Position = 0;
    if (append) entryStream.Seek(0, SeekOrigin.End);
    stream.CopyTo(entryStream);
    entryStream.Flush();
}

 

 

Kostiantyn
Top achievements
Rank 1
Iron
 asked on 06 Feb 2024
0 answers
85 views
I have a RadPane within my application that users can detach to create a floating window through a drag action. I am seeking a method to programmatically re-dock this floating RadPane to its original position within the application's main window, without resorting to dragging it manually. I aim to achieve this re-docking process entirely through code. Furthermore, I prefer a solution that does not involve restoring the layout from a stream, as commonly suggested. Is there a direct approach or function provided by the Telerik UI for WPF library that facilitates this? My objective is to manage the docking state of RadPane programmatically.
Ohad
Top achievements
Rank 3
Bronze
Iron
Iron
 asked on 05 Feb 2024
1 answer
1.1K+ views

I am learning game programming  in C# with WPF using MSVS-2022.

 For this MSVS-2022 offers two types of project:

WPF Application
A project creating a .NET WPF Application
and
WPF App (.NET Framework)
Windows Presentation Foundation client application

 

I googles these and still cannot figure out what is the difference - they both are for WPF application,

Which one is more suitable for game programming?

And will the code written using WPF Application  - could it be copied to a WPF App (.NET Framework) and run without corrections?

Dimitar
Telerik team
 answered on 05 Feb 2024
2 answers
110 views

Hello everyone,

 

on my WPF application I have to use a WizardPages component to make a configuration. These configuration (and the relative pages) may changes based on a combobox item selectable on the first WizardPage (a page in common for all configurations).

My question is.... It's possible to add WizardPages dynamically based on the selection on the combobox of first page?

 

Thank you

 

 

 

 

Marco
Top achievements
Rank 1
Iron
 answered on 02 Feb 2024
1 answer
70 views

Hi, we have implemented the ExportToXlsx method and it worked really well out the box.. however we are utilising the paging method (also the group before paging too) and would like the export to give us all the data returned - this is present in the dataset, so no additional call is needed to get more pages.

Any assistance would be great.

 

Matthew

Martin Ivanov
Telerik team
 answered on 01 Feb 2024
1 answer
77 views

Hi Team,

   I followed the online documentation of RadPersistenceFramework to persist the selected fields of  RadPivotFieldList.   It doesn't work!  Here's my code.

 

--xmal

                <pivot:RadPivotFieldList x:Name="pfAttributes" Grid.Row="0" telerik:PersistenceManager.StorageId="pvFields"
                                     VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Width="250"
                                     DataProvider="{StaticResource DataProviderKeyMetrics}" />

--save layout

            IsolatedStorageProvider isoStorageProvider = new IsolatedStorageProvider();
            isoStorageProvider.SaveToStorage();

-- load layout

            IsolatedStorageProvider isoStorageProvider = new IsolatedStorageProvider();
            isoStorageProvider.LoadFromStorage();

 

            Thanks,

 

Martin Ivanov
Telerik team
 answered on 29 Jan 2024
0 answers
73 views
moved to ticket
n/a
Top achievements
Rank 1
 updated question on 26 Jan 2024
1 answer
70 views

Currently I'm using a ProjectItem classes and FileItem classes into a RadTreeView for displaying the ProjectItem content. And when I'm trying to handle the Edited event, there occurs a problem with Old and New value, in case that given objects to RadTreeView.ItemsSource will be a reference type, it might create a problem. 

I would like to handle the Edited event for checking the NewValue, and according to conditions return there a OldValue.

Github with the solution

Dimitar
Telerik team
 answered on 26 Jan 2024
1 answer
108 views
I have a `RadPanelBar` bound to an `ItemsSource`.    I have it set to `SelectionMode` single.  And my view-model ensures that there is always a a selected item. 

But how do I force the Panel Bar to make the selected item always be expanded.   I do not want to allow the user to be allowed to ever collapse it. Is it a property I can set in the ItemContainerStyle? Something else?

At one point I tried binding the RadPanelBarItem.IsExpanded property to its `IsSelected` property.  But that didn't work.



<tk:RadPanelBar x:Name="PanelBar" BorderThickness="0"  
        Padding="0 3 0 0" 
        tk:AnimationManager.IsAnimationEnabled="True"
        SelectedItem="{Binding CurrentAnalysisCategory, Mode=TwoWay}"
        ItemsSource="{Binding AnalysisCategories}"
        VerticalContentAlignment="Stretch"
        VerticalAlignment="Stretch">


 <tk:RadPanelBar.Resources>
 <DataTemplate DataType="{x:Type avm:RoutinesVm}">
 <views:RoutinesPanel />
 </DataTemplate>
 <DataTemplate DataType="{x:Type avm:MeasurementsVm}">
 <views:MeasurementsPanel/>
 </DataTemplate>
<DataTemplate x:Key="ViewTemplate">
<ContentPresenter Content="{Binding}" />
 </DataTemplate>
 </tk:RadPanelBar.Resources>

 <tk:RadPanelBar.ItemTemplate>

<HierarchicalDataTemplate 
                ItemsSource="{Binding Data}"
				    ItemTemplate="{StaticResource ViewTemplate}">
			 <TextBlock Text="{Binding Name}" HorizontalAlignment="Center" VerticalAlignment="Center" />
</HierarchicalDataTemplate>


 </tk:RadPanelBar.ItemTemplate>

 <tk:RadPanelBar.ItemContainerStyle>
 <Style TargetType="{x:Type tk:RadPanelBarItem}">
                <Setter Property="Padding"                  Value="3"/>
                <Setter Property="VerticalAlignment"        Value="Stretch"/>
                <Setter Property="VerticalContentAlignment" Value="Stretch"/>
                <Setter Property="MinHeight"                Value="0"/>
                <Setter Property="BorderThickness"          Value="0"/>
                <Setter Property="MaxHeight"                Value="{Binding ElementName='Root', Path=MaxItemHeight}"/>
                <Setter Property="MaxWidth"                 Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type views:ScanImagePanel}}, Path=ActualWidth}"/>
                <Setter Property="tk:AnimationManager.AnimationSelector" Value="{StaticResource FastAnimator}"/>

            </Style>
 </tk:RadPanelBar.ItemContainerStyle>


 </tk:RadPanelBar>




Dimitar
Telerik team
 answered on 26 Jan 2024
1 answer
57 views
I want to zoom and pan the chart using the keyboard with the plus/minus and cursor keys. This works for the Map Control. However, I'm unable to use the mouse to set the focus on the chart to receive keys. I can tab to the chart, not clicking the mouse does not work and the focus remains on the currently focused element.
Martin Ivanov
Telerik team
 answered on 25 Jan 2024
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?