0
我有頁面被設置爲地圖點瀏覽。我想向用戶顯示一個邊框。這個邊框包含了用戶的信息(它有點像消息框)。在用戶活動期間WP7計時器回調沒有被觸發
我使用MVVM模板...
我想在3秒後隱藏邊框。一切正常(3秒後隱藏邊框)直到我開始移動地圖控件。那麼邊界永遠不會隱藏。
附代碼解釋更多...從我查看XAML代碼
部分:
<Grid>
<my:Map
Margin="0,0,0,0"
x:Name="MainMap"
CredentialsProvider="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
Center="{Binding MapCenter, Mode=TwoWay}"
ZoomLevel="{Binding ZoomLevel, Mode=TwoWay}"
myMapViewModel:BindingHelpers.TileSource="{Binding CurrentMap}"
myMapViewModel:BindingHelpers.PointsSource="{Binding Points}"
myMapViewModel:BindingHelpers.CurrentPositionPushpin="{Binding CurrentGeoPosition}"
myMapViewModel:BindingHelpers.KmlPointSelectedCommand="{Binding ShowSelectedKmlPointCommand}"
Grid.Row="0"
CopyrightVisibility="Collapsed"
ZoomBarVisibility="Collapsed"
Padding="0"
>
<my:Map.Mode>
<MSPCMCore:MercatorMode/>
</my:Map.Mode>
<TextBlock
Grid.Row="0"
x:Name="MapNameTile"
Text="{Binding CurrentMapName}"
Opacity="0.5"
Style="{StaticResource PhoneTextNormalStyle}"
VerticalAlignment="Top"
HorizontalAlignment="Left"
Canvas.ZIndex="2"
Foreground="{StaticResource PhoneAccentBrush}"
/>
</my:Map>
<Border
Canvas.ZIndex="20"
Background="{StaticResource PhoneAccentBrush}"
Opacity="0.85"
Height="100"
Width="430"
VerticalAlignment="Top"
HorizontalAlignment="Center"
CornerRadius="15"
Padding="15"
Margin="0,25,0,0"
Visibility="{Binding IsInformationPanelVisible, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"
>
<TextBlock
Style="{StaticResource PhoneTextNormalStyle}"
TextWrapping="Wrap"
Text="{Binding InformationPanelText}"
/>
</Border>
從視圖模型我的部分代碼:
public bool IsInformationPanelVisible
{
get
{
return this._isInformationPanelVisible;
}
set
{
if (this._isInformationPanelVisible == value)
{
return;
}
this._isInformationPanelVisible = value;
if (this._isInformationPanelVisible)
{
new Timer((state) =>
{
this.IsInformationPanelVisible = false;
}, null, 3000, 0);
}
DispatcherHelper.CheckBeginInvokeOnUI(() =>
{
RaisePropertyChanged("IsInformationPanelVisible");
});
}
}
我的問題是:爲什麼在用戶觸摸顯示屏並移動地圖的情況下不起作用?
這是不可能的調試它。
我接受了測試,看起來定時器回調沒有被觸發。