or
<Window x:Class="Imagine.TelerickTest.RichTextBox.WithoutMVVM" xmlns:my="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Documents" xmlns:radDoc ="clr-namespace:Telerik.Windows.Documents.Model;assembly=Telerik.Windows.Documents" Title="WithoutMVVM" Height="500" Width="500"> <DockPanel> <StackPanel DockPanel.Dock="Top"> <TextBlock Text="Input"></TextBlock> <TextBox x:Name="txtInput" ></TextBox> </StackPanel> <Button x:Name="btnClick" Content="Click" Click="btnClick_Click" DockPanel.Dock="Top"></Button> <my:RadRichTextBox x:Name="txtMessage" LayoutMode="Flow"></my:RadRichTextBox> </DockPanel></Window>public WithoutMVVM() { InitializeComponent(); } private void btnClick_Click(object sender, RoutedEventArgs e) { var span = new Telerik.Windows.Documents.Model.Span(txtInput.Text); var p = new Telerik.Windows.Documents.Model.Paragraph(); p.Inlines.Add(span); var section = new Telerik.Windows.Documents.Model.Section(); section.Blocks.Add(p); txtMessage.Document.Sections.Add(section); }
<telerik:RadBusyIndicator IsBusy="{Binding IsWorking}" BusyContent="Loading..." /> And in my App object I do (OnStartup event):When I run my application. So I get this error:StyleManager.ApplicationTheme = new MetroTheme();
var findResource = FindResource("BaseColor");
if (findResource != null)
MetroColors.PaletteInstance.AccentColor = (Color)findResource;
<
telerik:RadOutlookBar x:Name="RadOutlookBar1"
MaxWidth="760" ItemsSource="{Binding}"
ItemTemplate="{StaticResource BarTemplate}"
ContentTemplate="{StaticResource redefineoutlook}"
TitleTemplate="{StaticResource BarTemplate}"
Margin="0,0,330,0" ItemDropDownContentTemplate="{StaticResource BarTemplate}">
<DataTemplate x:Key="BarTemplate" >
<TextBlock Text="{Binding Path=A}" FontWeight="Bold" />
</DataTemplate>
Using Telerik WPF for .NET 4
OS: Windows Server 2008
Assuming a RadGridView named "grid" is defined in XAML the following code works in
WPF Version 2011.2.712.40 but not in later versions such as 2011.2.920.40 or 2011.2.1010.40.
Calling grid.Rebind() however works for all versions.
Expected result:
Calling mi1_Click should update the value in the first cell of the grid.public partial class MainWindow : Window { private ObservableCollection<MyDynamicObject> myObjects; private int Counter; public MainWindow() { InitializeComponent(); myObjects = new ObservableCollection<MyDynamicObject>(); for (int i = 0; i < 5; i++) { dynamic myObject = new MyDynamicObject(); myObjects.Add(myObject); } GridViewDataColumn col = new GridViewDataColumn(); col.Header = "Prop1"; col.DataMemberBinding = new Binding("Prop1"); col.DataType = typeof(string); grid.Columns.Add(col); grid.ItemsSource = myObjects; } private void mi1_Click(object sender, RoutedEventArgs e) { MyDynamicObject myObj = myObjects[0]; Counter++; myObj.PropertyDict["Prop1"] = Counter.ToString(); myObj.NotifyPropertyChanged("Prop1"); } } public class MyDynamicObject : DynamicObject, INotifyPropertyChanged { public readonly Dictionary<string, object> PropertyDict; public event PropertyChangedEventHandler PropertyChanged; public void NotifyPropertyChanged(string propertyName) { if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } public MyDynamicObject() { PropertyDict = new Dictionary<string, object>(); } public override bool TryGetMember(GetMemberBinder binder, out object result) { string propertyName = binder.Name; object obj1; result = null; if (PropertyDict.TryGetValue(propertyName, out obj1)) result = obj1; return true; } public override bool TrySetMember(SetMemberBinder binder, object value) { string propertyName = binder.Name; PropertyDict[propertyName] = value; return true; } }