第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

執(zhí)行故事板以關(guān)閉在 showdialog 中打開的窗口時(shí)出錯(cuò)

執(zhí)行故事板以關(guān)閉在 showdialog 中打開的窗口時(shí)出錯(cuò)

C#
猛跑小豬 2021-08-22 17:17:35
當(dāng)Storyboard關(guān)閉窗口“This Visual is not connected to a PresentationSource”時(shí),我得到了這個(gè)錯(cuò)誤。我的場景包括兩個(gè)窗口和一個(gè) UserControl這是window1的xaml代碼:<Window x:Name="LWindow" x:Class="WpfAppXtesting.WindowTest1"    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"    xmlns:local="clr-namespace:WpfAppXtesting"    mc:Ignorable="d"    WindowStyle="None"    Title="WindowTest1" Height="160" Width="435"><Window.Resources>    <ResourceDictionary>        <ResourceDictionary.MergedDictionaries>        </ResourceDictionary.MergedDictionaries>        <!-- Storyboard -->        <Storyboard x:Key="OpenLWindow">            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="LWindow">                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>                <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="434.4"/>            </DoubleAnimationUsingKeyFrames>            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="LWindow">                <EasingDoubleKeyFrame KeyTime="0" Value="37"/>                <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="37"/>                <EasingDoubleKeyFrame KeyTime="0:0:1" Value="159.8"/>            </DoubleAnimationUsingKeyFrames>        </Storyboard>    
查看完整描述

1 回答

?
楊__羊羊

TA貢獻(xiàn)1943條經(jīng)驗(yàn) 獲得超7個(gè)贊

嘗試使用Dispatcher類在消息循環(huán)的下一次迭代中關(guān)閉窗口:


private void CloseLWindow_Completed(object sender, EventArgs e)

{

    Dispatcher.BeginInvoke(new Action(() => Close()));

}


查看完整回答
反對 回復(fù) 2021-08-22
  • 1 回答
  • 0 關(guān)注
  • 233 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)