protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e) { base.OnPropertyChanged(e); if (e.Property == TextProperty) { Inlines.Clear(); var canvas = new EmojiCanvas(); canvas.Reset(Text, FontSize); Inlines.Add(new InlineUIContainer(canvas)); } }
// Need an empty constructor for serialisation (undo/redo) public EmojiInline() { // FIXME: not sure this is the correct value; but Baseline does not work. BaselineAlignment = BaselineAlignment.TextBottom; Child = new EmojiCanvas(); }