or
I created a class with CommunityToolkit.Mvvm package and use ObservableProperty to create properties for this class. But the PropertyGrid control does not recognize properties created in this way. Are there any way PropertyGrid can support ObservableProperty?
using CommunityToolkit.Mvvm.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace Test
{
public partial class DrawingModel : ObservableObject
{
public string Name { get; set; }
[ObservableProperty]
public double _length;
[ObservableProperty]
public double _width;
[ObservableProperty]
public double _height;
}
}
Please see attached image. What could be the cause of this? Some Fonts missing?
I'm using StyleManager for Theming.
Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.DocxFormatProvider provider = new Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.DocxFormatProvider(); RadDocument document = new RadDocument(string myXAMLString); byte[] output = provider.Export(document);
Hi,
i found a sample:
<Window.Resources>
<local:DoubleToDateTimeLabelConverter x:Key="DoubleToDateTimeLabelConverter" />
</Window.Resources>
<Grid>
<telerik:RadCartesianChart>
<telerik:RadCartesianChart.HorizontalAxis>
<telerik:LinearAxis>
<telerik:LinearAxis.LabelTemplate>
<DataTemplate>
<TextBlock Text="{Binding StringFormat='h:MM tt', Converter={StaticResource DoubleToDateTimeLabelConverter}}" />
</DataTemplate>
</telerik:LinearAxis.LabelTemplate>
</telerik:LinearAxis>
</telerik:RadCartesianChart.HorizontalAxis>
<telerik:RadCartesianChart.VerticalAxis>
<telerik:CategoricalAxis />
</telerik:RadCartesianChart.VerticalAxis>
<telerik:LineSeries CategoryBinding="City" ValueBinding="StartTimeOA" ItemsSource="{Binding}" />
</telerik:RadCartesianChart>
</Grid>
public MainWindow()
{
InitializeComponent();
var Items = new ObservableCollection<PlotItemViewModel>();
var dateTime = DateTime.Now;
Items.Add(new PlotItemViewModel() { City = "Atlanta", StartTime = dateTime.AddMinutes(5) });
Items.Add(new PlotItemViewModel() { City = "Atlanta", StartTime = dateTime.AddMinutes(10), });
Items.Add(new PlotItemViewModel() { City = "New York", StartTime = dateTime.AddMinutes(100), });
Items.Add(new PlotItemViewModel() { City = "Miami", StartTime = dateTime.AddMinutes(120), });
Items.Add(new PlotItemViewModel() { City = "Miami", StartTime = dateTime.AddMinutes(150), });
Items.Add(new PlotItemViewModel() { City = "Savannah", StartTime = dateTime.AddMinutes(200), });
Items.Add(new PlotItemViewModel() { City = "Birmingham", StartTime = dateTime.AddMinutes(250), });
Items.Add(new PlotItemViewModel() { City = "New Orleans", StartTime = dateTime.AddMinutes(280), });
this.DataContext = Items;
}
}
public class PlotItemViewModel
{
public string City { get; set; }
public DateTime StartTime { get; set; }
public double StartTimeOA { get { return this.StartTime.ToOADate(); } }
}
public class DoubleToDateTimeLabelConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
double doubleValue = double.Parse(value.ToString());
return DateTime.FromOADate(doubleValue);
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
}
The Result is:
Here is the Dateformat "us-US" (10:05 AM / 4:06 PM) but i need German "de-DE" (10:05 / 16:06) !
Have anyone a idea how i can do this?
Best regards
Bernd