Windows Store-Kit を使用して Windows Phone 8 アプリをテストしましたが、失敗しました。「リソース使用率が高い」と表示されます。私は MVVM-Pattern を使用しています。つまり、View 内の Elements を ViewModel プロパティにバインドしています。
使用率が高い場合の例: ContentControl を持つ MainView があります。ContentControl のコンテンツは別のビューです (ChildView と呼びましょう)。ChildView の TextBox をクリックすると、InputScope がポップアップし (入力できる場所)、View が表示されるので、TextBox が表示されます。ビューが上がると (TextBox がピボットにあることに注意してください)、遅延が始まります。TextBox のみにフォーカスし、PivotItem が上がるため、理由はわかりません。私の質問は、リソースの使用率を下げるにはどうすればよいですか? 必要なものがあれば、書いてください。ここに投稿します。
MainPage.xaml
<Grid>
<Grid x:Name="LayoutRoot" HorizontalAlignment="Left">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<ScrollViewer Name="MyScrollViewer" Height="Auto" HorizontalAlignment="Left" VerticalAlignment="Top" Width="Auto" HorizontalScrollBarVisibility="{Binding Horizontal}" VerticalScrollBarVisibility="{Binding Vertical}">
<!--ContentPanel - zusätzliche Inhalte hier platzieren-->
<StackPanel ScrollViewer.HorizontalScrollBarVisibility="Auto" Grid.Row="2" Opacity="50">
<ContentControl Content="{Binding MyContent}" Name="MyContentControl" IsTabStop="False" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch"/>
</StackPanel>
</ScrollViewer>
</Grid>
</Grid>
ChildView.xaml http://textuploader.com/?p=6&id=zMDoD
Store-Kit の結果 (ドイツ語ですが、わかりやすいと思います) http://i.imagebanana.com/img/j6z24o9a/Unbenannt.png
これは、ビューの ViewModel のプロパティがどのように見えるかです (ストア キットの結果に表示されます)。
private string _anlohnsteuer;
public string ANLohnsteuer
{
get { return _anlohnsteuer; }
set
{
_anlohnsteuer = value;
RaisePropertyChanged(() => ANLohnsteuer);
}
}