Проблемы с присоединяемыми свойствами и ссылками на сборки - PullRequest
0 голосов
/ 16 января 2020
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
         xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
         xmlns:d="http://xamarin.com/schemas/2014/forms/design"
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
         mc:Ignorable="d"
         x:Class="Counter.Page1">
<ContentPage.Content>
    <StackLayout BackgroundColor="White" Padding="60" VerticalOptions="Center">
        <Label Text="{Binding MainPageEditorText}">
            <Label.LayoutTransform>
                <ScaleTransform ScaleX="-1.0"/>
            </Label.LayoutTransform>
        </Label>
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal">
                    <VisualState.Setters>
                        <Setter Property="Scale"
                        Value="1" />
                    </VisualState.Setters>
                </VisualState>

                <VisualState x:Name="Pressed">
                    <VisualState.Setters>
                        <Setter Property="Scale"
                        Value="0.99" />
                    </VisualState.Setters>
                </VisualState>

            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
    </StackLayout>
</ContentPage.Content>

При попытке применить LayoutTransform к моей метке я получаю две разные ошибки.

Ошибки следующие:

XLS0415 - Присоединяемый свойство «LayoutTransform» не найдено в типе «Label».
XLS0414 - Тип «ScaleTransform» не найден. Убедитесь, что вы не пропустили ссылку на сборку и что все сборки, на которые имеются ссылки, были собраны.

1 Ответ

0 голосов
/ 16 января 2020
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
         xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
         xmlns:d="http://xamarin.com/schemas/2014/forms/design"
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
         mc:Ignorable="d"
         x:Class="Counter.Page1">
<ContentPage.Content>
    <StackLayout BackgroundColor="White" Padding="60" VerticalOptions="Center">
        <Label Text="{Binding MainPageEditorText}" ScaleX="-1.0">
        </Label>
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal">
                    <VisualState.Setters>
                        <Setter Property="Scale"
                        Value="1" />
                    </VisualState.Setters>
                </VisualState>

                <VisualState x:Name="Pressed">
                    <VisualState.Setters>
                        <Setter Property="Scale"
                        Value="0.99" />
                    </VisualState.Setters>
                </VisualState>

            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
    </StackLayout>
</ContentPage.Content>

Не важно, что я справился с этим, просто поместив ScaleX в ярлык напрямую.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...