I'm working on the iOS
part of a Xamarin
project and am using the XCode
interface designer for the UI
. For the data-binding
of the interface
elements we are using MvvmCross
and now I'm facing the following issue:
I'm binding the text/label of an UITextView
and a UIButton
and that works fine. However, the font
I've setup for these elements in the interface designer is reset if I apply the binding. (Both font-type
and font-color
are reset to the default font and color.) If I remove the binding, then I see font and color on the mobile device as configured in the designer. I'm using the following lines to setup the binding:
this.CreateBinding(this.theText).For("Text")
.To((theViewModel vm) => vm.TextSource)
.WithConversion(new MvxLanguageConverter(), "theText")
.Apply();
this.CreateBinding(this.theButton)
.To((theViewModel vm) => vm.theButtonCommand)
.Apply();
this.CreateBinding(this.theButton).For("Title")
.To((theViewModel vm) => vm.TextSource)
.WithConversion(new MvxLanguageConverter(), "theButton")
.Apply();
Is there a way to set this up so that font
and color
are preserved? If not I can setup these elements in code, but I prefer to do the design in the designer as much as possible.
Thanks! Olaf
PS. see comments, this is apparently not related to data-binding using MvvmCross. However, the proposed solutions in the other post basically suggest to make a new attributed string using the existing attributes and I don't see how you would do this using binding.