Created
November 13, 2014 00:27
-
-
Save BryanWilhite/23aa4f664ee474ad2d94 to your computer and use it in GitHub Desktop.
C#, Silverlight/Telerik: RadDataFormTextLookupField
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Windows.Controls; | |
using GalaSoft.MvvmLight.Messaging; | |
using Telerik.Windows.Controls; | |
namespace Fox.Xavier.Client.Views | |
{ | |
using Fox.Silverlight.Models; | |
using Fox.Xavier.Client.Models; | |
public class RadDataFormTextLookupField : DataFormDataField | |
{ | |
protected override Control GetControl() | |
{ | |
var binding = this.DataMemberBinding; | |
var element = new TextBlock(); | |
var content = new LightContentForFrameworkElement<TextBlock> | |
{ | |
BindingOfContext = binding, | |
DataOfContext = this.DataContext, | |
Element = element | |
}; | |
var message = new LightMessage<LightContentForFrameworkElement<TextBlock>>(content) | |
{ | |
Source = LightMessageSource.ViewAddedChildren, | |
UniqueId = "RadBoundControl" | |
}; | |
Messenger.Default.Send(message); | |
return new ContentControl() { Content = element }; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment