积极答复者
windows8应用商店意外关闭的原因.

问题
答案
-
8.1 一般狀況應該沒這問題.
除非你有加上 ApplicationView 的控制, 類似下的 xaml code. 你的 xaml 中有 VisualStateManager 嗎 ?
或是你的程式碼中有掛上 Windows.SizeChanged 事件 ?
<VisualStateManager.VisualStateGroups> <VisualStateGroup> <VisualState x:Name="Narrow"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="typicalPanel" Storyboard.TargetProperty="Visibility"> <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="narrowPanel" Storyboard.TargetProperty="Visibility"> <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> </VisualStateGroup> </VisualStateManager.VisualStateGroups>
Handling VisualState in Windows 8.1 Store appsWindow.Current.SizeChanged += Window_SizeChanged;
在現實生活中,你和誰在一起的確很重要,甚至能改變你的成長軌跡,決定你的人生成敗。 和什麼樣的人在一起,就會有什麼樣的人生。 和勤奮的人在一起,你不會懶惰; 和積極的人在一起,你不會消沈; 與智者同行,你會不同凡響; 與高人為伍,你能登上巔峰。
- 已编辑 Bill ChungMVP 2014年11月28日 9:25
- 已标记为答案 XiaoTianShi 2014年12月2日 9:01
-
你的頁面上應該是有設定 VisualState 的 xaml Code, 因為在縮小時會觸發 narrow 可視狀態, 在那個狀態的 xaml code 中應該是有對一個名稱為 backButton 的 element 操作, 但你畫面上並沒有這個元素, 因此出錯.
在現實生活中,你和誰在一起的確很重要,甚至能改變你的成長軌跡,決定你的人生成敗。 和什麼樣的人在一起,就會有什麼樣的人生。 和勤奮的人在一起,你不會懶惰; 和積極的人在一起,你不會消沈; 與智者同行,你會不同凡響; 與高人為伍,你能登上巔峰。
- 已标记为答案 XiaoTianShi 2014年12月3日 2:09
全部回复
-
Windows 8.0 還是 Windows 8.1 ?
如果是 8.0, 表示可能是在 Snapview 切換時出錯. 檢查xaml 關於 snapview 切換的部分
在現實生活中,你和誰在一起的確很重要,甚至能改變你的成長軌跡,決定你的人生成敗。 和什麼樣的人在一起,就會有什麼樣的人生。 和勤奮的人在一起,你不會懶惰; 和積極的人在一起,你不會消沈; 與智者同行,你會不同凡響; 與高人為伍,你能登上巔峰。
- 已编辑 Bill ChungMVP 2014年11月28日 8:56
-
8.1 一般狀況應該沒這問題.
除非你有加上 ApplicationView 的控制, 類似下的 xaml code. 你的 xaml 中有 VisualStateManager 嗎 ?
或是你的程式碼中有掛上 Windows.SizeChanged 事件 ?
<VisualStateManager.VisualStateGroups> <VisualStateGroup> <VisualState x:Name="Narrow"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="typicalPanel" Storyboard.TargetProperty="Visibility"> <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="narrowPanel" Storyboard.TargetProperty="Visibility"> <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> </VisualStateGroup> </VisualStateManager.VisualStateGroups>
Handling VisualState in Windows 8.1 Store appsWindow.Current.SizeChanged += Window_SizeChanged;
在現實生活中,你和誰在一起的確很重要,甚至能改變你的成長軌跡,決定你的人生成敗。 和什麼樣的人在一起,就會有什麼樣的人生。 和勤奮的人在一起,你不會懶惰; 和積極的人在一起,你不會消沈; 與智者同行,你會不同凡響; 與高人為伍,你能登上巔峰。
- 已编辑 Bill ChungMVP 2014年11月28日 9:25
- 已标记为答案 XiaoTianShi 2014年12月2日 9:01
-
大神你好,
我调试了一下代码发现确实调用了
Window.Current.SizeChanged += Window_SizeChanged;
这个方法,我注释掉这个方法就没问这个问题了。
this.StartLayoutUpdates(sender, e);
我想请问一下这个方法是用来做说明的 具体是什么意思呢,求解.
public void StartLayoutUpdates(object sender, RoutedEventArgs e)
{
var control = sender as Control;
if (control == null) return;
if (this._layoutAwareControls == null)
{
// 当更新中存在相关控件时,开始侦听视图状态更改
Window.Current.SizeChanged += this.WindowSizeChanged;
this._layoutAwareControls = new List<Control>();
}
this._layoutAwareControls.Add(control);// 设置控件的初始可视状态
VisualStateManager.GoToState(control, DetermineVisualState(ApplicationView.Value), false);
} -
调用那个方法抛出的异常是这样
System.Exception: 没有检测到已安装的组件。
Cannot resolve TargetName backButton.
at Windows.UI.Xaml.VisualStateManager.GoToState(Control control, String stateName, Boolean useTransitions)
at MoHost.Common.LayoutAwarePage.StartLayoutUpdates(Object sender, RoutedEventArgs e)
at MoHost.Common.LayoutAwarePage.<.ctor>b__0(Object sender, RoutedEventArgs e)求大神告诉下是什么原因,感激不尽,好人一生平安。
-
你的頁面上應該是有設定 VisualState 的 xaml Code, 因為在縮小時會觸發 narrow 可視狀態, 在那個狀態的 xaml code 中應該是有對一個名稱為 backButton 的 element 操作, 但你畫面上並沒有這個元素, 因此出錯.
在現實生活中,你和誰在一起的確很重要,甚至能改變你的成長軌跡,決定你的人生成敗。 和什麼樣的人在一起,就會有什麼樣的人生。 和勤奮的人在一起,你不會懶惰; 和積極的人在一起,你不會消沈; 與智者同行,你會不同凡響; 與高人為伍,你能登上巔峰。
- 已标记为答案 XiaoTianShi 2014年12月3日 2:09