Проблема которая сводит меня с ума) Люди помогите(
Есть простой Xaml:
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Kitchener"
x:Class="Kitchener.MainPage"
xmlns:al="clr-namespace:AiForms.Layouts;assembly=AiForms.Layouts"
xmlns:viewModel="clr-namespace:Kitchener.ViewModels;assembly=Kitchener"
x:Name="_this">
<ContentPage.BindingContext>
<viewModel:KitchenerMainPageVm />
</ContentPage.BindingContext>
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="10" />
<RowDefinition Height="2*" />
<RowDefinition Height="40" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label Text="{Binding MessageText}"
TextColor="{Binding MessageTextColor}"
IsVisible="{Binding MessageTextVisible}"
HorizontalOptions="Center"
VerticalOptions="Center" Grid.Row="1" FontSize="30" Margin="0,20,0,20" />
<StackLayout Grid.Row="2" Orientation="Horizontal">
<Button Text="#" Command="{Binding ShowHideSettings}" WidthRequest="40"/>
<StackLayout IsVisible="{Binding SettingIsVisible}" Orientation="Horizontal" HorizontalOptions="FillAndExpand">
<Entry Placeholder="Url Bullet Server"
FontSize="15"
Text="{Binding BaseUrl, Mode=TwoWay}"
Completed="BaseUrl_OnCompleted"
HorizontalOptions="FillAndExpand"/>
</StackLayout>
</StackLayout>
</Grid>
</ContentPage>
Есть простой ViewModel:
public class KitchenerMainPageVm : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
private string _baseUrl;
public string BaseUrl
{
set
{
_baseUrl = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("BaseUrl"));
Settings.BaseUrlBulletHttpServer = _baseUrl;
}
get => _baseUrl;
}
private string _messageText = "Соединение...";
public string MessageText
{
set
{
_messageText = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(MessageText)));
}
get
{
return _messageText;
}
}
private bool _messageTextVisible = false;
public bool MessageTextVisible
{
set
{
_messageTextVisible = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("MessageTextVisible"));
}
get
{
return _messageTextVisible;
}
}
private Color _messageTextColor = Color.AliceBlue;
public Color MessageTextColor
{
set
{
_messageTextColor = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("MessageTextColor"));
}
get
{
return _messageTextColor;
}
}
private bool _buttonStackVisible = true;
public bool ButtonStackVisible
{
set
{
_buttonStackVisible = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("ButtonStackVisible"));
}
get
{
return _buttonStackVisible;
}
}
private bool _settingIsVisible;
public bool SettingIsVisible
{
set
{
_settingIsVisible = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("SettingIsVisible"));
}
get
{
return _settingIsVisible;
}
}
public ICommand ShowHideSettings { protected set; get; }
private void _showHideSettings()
{
SettingIsVisible = !SettingIsVisible;
}
public KitchenerMainPageVm()
{
BaseUrl = Settings.BaseUrlBulletHttpServer;
ShowHideSettings = new Command(_showHideSettings);
}
}
В режиме debug-сборки все прекрасно работает, но как только все это дело собираю в режиме release-сборки часть моих привязок и команда отваливаются.
Во что я вижу при развертывании:
[0:] Binding: 'MessageTextVisible' property not found on 'Kitchener.ViewModels.KitchenerMainPageVm', target property: 'Xamarin.Forms.Label.IsVisible' [0:] Binding: 'MessageTextColor' property not found on 'Kitchener.ViewModels.KitchenerMainPageVm', target property: 'Xamarin.Forms.Label.TextColor' [0:] Binding: 'MessageText' property not found on 'Kitchener.ViewModels.KitchenerMainPageVm', target property: 'Xamarin.Forms.Label.Text'
Работают привязки SettingIsVisible,BaseUrl,ButtonStackVisible остальные не работают, что бы я не делал.... и команда то же не работает...
Я сто раз его пересобирал, пробовал запускать на реальном устройстве(Android 7.1), на эмуляторе, все одно....
Пользуюсь VisualStudio 2017 Параметры сборки библиотеки http://joxi.ru/823kkB8FJNGa82 Андроид-проекта: http://joxi.ru/5md77LnikRZ8xr Версия SDK компилятора 8.1