HomePage.xaml.cs 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using System.Windows.Controls;
  8. using System.Windows.Data;
  9. using System.Windows.Documents;
  10. using System.Windows.Input;
  11. using System.Windows.Media;
  12. using System.Windows.Media.Animation;
  13. using System.Windows.Media.Imaging;
  14. using System.Windows.Navigation;
  15. using System.Windows.Shapes;
  16. using System.Windows.Threading;
  17. namespace HistoryDLL
  18. {
  19. /// <summary>
  20. /// HomePage.xaml 的互動邏輯
  21. /// </summary>
  22. public partial class HomePage : UserControl
  23. {
  24. public event EventHandler OnLoadProgessComplete;
  25. DispatcherTimer dt = new DispatcherTimer();
  26. Storyboard progressWidthStoryBoard = new Storyboard();
  27. Storyboard progressHeightStoryBoard = new Storyboard();
  28. DoubleAnimation dbOffsetWidth;
  29. DoubleAnimation dbOffsetHeight;
  30. //亂數飛入
  31. private Random rnd = new Random(Guid.NewGuid().GetHashCode());
  32. //Block size
  33. private int blockWidth = 0;
  34. private int blockHeight = 0;
  35. private int nonesize = 0;
  36. //事件數量
  37. private int eventTotalCount = 0;
  38. //載入完成數量
  39. private int eventLoadCount = 0;
  40. //歷史牆控制項
  41. private Grid HistoryWallControl = new Grid();
  42. //區塊大小設定
  43. private static int cutForTwowidth = 289;
  44. private static int cutForTwoheight = 224;
  45. private static int cutForSixwidth = 209;
  46. private static int cutForSixheight = 157;
  47. //紀錄顯示畫面的年份
  48. public List<XmlData> xmlDataList = new List<XmlData>();
  49. public List<Border> borderlist = new List<Border>();
  50. public List<MyBorder> myborderList = new List<MyBorder>();
  51. public int StoryBoardTime = 200;
  52. public int DelayTimeRate = 100;
  53. public int HistoryWallTime = 600;
  54. SolidColorBrush sb = new SolidColorBrush(ConfigSettingClass.TimelineCollect.BackgroundColor);
  55. private SolidColorBrush TextBlockExtendColor = new SolidColorBrush(ConfigSettingClass.TimelineCollect.TextColor);
  56. public HomePage(int width, int height)
  57. {
  58. InitializeComponent();
  59. this.uxLoadBar.Width = width;
  60. this.uxLoadBar.Height = height;
  61. if (GlobalFunction.isSolutionUsing4K)
  62. {
  63. cutForTwowidth *= 2;
  64. cutForTwoheight *= 2;
  65. cutForSixwidth *= 2;
  66. cutForSixheight *= 2;
  67. uxProgressBar.Height *= 2;
  68. uxProgressBar.Margin = new Thickness(0, uxProgressBar.Margin.Top * 2, 0, 0);
  69. }
  70. SetStoryboardMotionX();
  71. SetStoryboardMotionY();
  72. uxProgressBar.Background = sb;
  73. uxLoadingProgress.LoadingCompleted += new EventHandler(uxLoadingProgress_LoadingCompleted);
  74. uxLoadingProgress.Start();
  75. uxLoadingProgress.Minimum = 0;
  76. uxLoadingProgress.Maximum = 100;
  77. }
  78. private void uxLoadingProgress_LoadingCompleted(object sender, EventArgs e)
  79. {
  80. progressWidthStoryBoard.Stop();
  81. dbOffsetWidth.From = this.uxProgressBar.Width;
  82. dbOffsetWidth.To = (eventLoadCount * this.uxLoadBar.Width) / eventTotalCount;
  83. progressWidthStoryBoard.Begin();
  84. uxLoadingProgress.Visibility = System.Windows.Visibility.Collapsed;
  85. CloseLoadingMap();
  86. OnLoadProgessComplete?.Invoke(this,null);
  87. }
  88. private void CloseLoadingMap()
  89. {
  90. for (int i = 0; i < 60; i++)
  91. {
  92. Path path = new Path();
  93. path = FindName("m" + string.Format("{0:D2}", i)) as Path;
  94. path.Visibility = System.Windows.Visibility.Collapsed;
  95. }
  96. Grid gd = new Grid();
  97. gd = FindName("m60") as Grid;
  98. gd.Visibility = System.Windows.Visibility.Collapsed;
  99. }
  100. public void SetBlockCommonSetting(int width, int height, int nousesize)
  101. {
  102. blockWidth = width;
  103. blockHeight = height;
  104. nonesize = nousesize;
  105. if (GlobalFunction.isSolutionUsing4K)
  106. {
  107. //blockWidth *= 2;
  108. //blockHeight *= 2;
  109. //nonesize *= 2;
  110. }
  111. }
  112. private void HistoryWallStart()
  113. {
  114. dt.Interval = TimeSpan.FromMilliseconds(HistoryWallTime);
  115. dt.Tick += new EventHandler(dt_Tick);
  116. dt.Start();
  117. }
  118. void dt_Tick(object sender, EventArgs e)
  119. {
  120. dt.Stop();
  121. //將歷史牆提到最上層
  122. Canvas.SetZIndex(HistoryWallControl, 1);
  123. OpacityFadeInAndOut();
  124. }
  125. //設定時間讓歷史牆的Opacity漸改變
  126. private void OpacityFadeInAndOut()
  127. {
  128. Storyboard historywallshow = new Storyboard();
  129. DoubleAnimation dbOffset = new DoubleAnimation()
  130. {
  131. Duration = TimeSpan.FromMilliseconds(200),
  132. EasingFunction = new ExponentialEase()
  133. {
  134. EasingMode = EasingMode.EaseIn,
  135. Exponent = 3,
  136. },
  137. From = 0,
  138. To = 1
  139. };
  140. Storyboard.SetTarget(dbOffset, HistoryWallControl);
  141. Storyboard.SetTargetProperty(dbOffset, new PropertyPath(Grid.OpacityProperty));
  142. historywallshow.Completed += new EventHandler(historywallshow_Completed);
  143. historywallshow.Children.Add(dbOffset);
  144. historywallshow.FillBehavior = FillBehavior.HoldEnd;
  145. historywallshow.Begin();
  146. }
  147. void historywallshow_Completed(object sender, EventArgs e)
  148. {
  149. HistoryWallControl.Opacity = 1;
  150. //結束後~將歷史牆降到最下層~不然點擊會點不到
  151. Canvas.SetZIndex(HistoryWallControl, 0);
  152. uxLoadBar.Opacity = 0;
  153. ReleaseAllSetting();
  154. }
  155. //釋放所有資源
  156. private void ReleaseAllSetting()
  157. {
  158. xmlDataList = new List<XmlData>();
  159. borderlist = new List<Border>();
  160. myborderList = new List<MyBorder>();
  161. progressWidthStoryBoard = new Storyboard();
  162. progressHeightStoryBoard = new Storyboard();
  163. uxLoadBar.Visibility = System.Windows.Visibility.Collapsed;
  164. }
  165. //將每個年分區塊顯示出來~並且播放飛入的動畫
  166. private void ShowBlock()
  167. {
  168. uxProgressBar.Opacity = 0;
  169. uxGradientStop.Offset = 1;
  170. for (int i = 0; i < borderlist.Count; i++)
  171. {
  172. uxLoadBar.Children.Add(borderlist[i]);
  173. }
  174. this.Refresh();
  175. for (int i = 0; i < myborderList.Count; i++)
  176. {
  177. uxLoadBar.Children.Add(myborderList[i]);
  178. myborderList[i].FlyAnimationStart();
  179. this.Refresh();
  180. }
  181. }
  182. /// <summary>
  183. /// 設定每個Block的位置
  184. /// </summary>
  185. private void SetBlockPos()
  186. {
  187. int marginbtm = 250;
  188. if (GlobalFunction.isSolutionUsing4K)
  189. marginbtm *= 2;
  190. //設定每個年分區塊的位置
  191. for (int count = 0; count < borderlist.Count; count++)
  192. {
  193. //先設定第一個
  194. if (count == 0)
  195. {
  196. borderlist[count].Margin = new Thickness(-nonesize, 0, 0, marginbtm);
  197. continue;
  198. }
  199. borderlist[count].Margin = new Thickness(borderlist[count - 1].Margin.Left + blockWidth, 0, 0, marginbtm);
  200. }
  201. }
  202. /// <summary>
  203. /// 根據事件的數量~新建出Image並設定其動畫
  204. /// </summary>
  205. private void SetEventAnimation()
  206. {
  207. int eventcount = xmlDataList.Count;
  208. for (int index = 0; index < eventcount; index++)
  209. {
  210. //如果該年只有兩個事件~的動畫位置
  211. if (xmlDataList[index].monthclassList.Count <= 2)
  212. {
  213. for (int i = 0; i < xmlDataList[index].monthclassList.Count; i++)
  214. {
  215. int randonvalue = rnd.Next(0, 401);
  216. if (i == 0)
  217. {
  218. int fitValue = 92;
  219. if (GlobalFunction.isSolutionUsing4K)
  220. fitValue *= 2;
  221. //區塊寬度, 區塊高度, 該區塊的起始位置 (左 + 底), 該區塊飛入後的終點位置 (左 + 底) + 動畫時間, 動畫的延遲時間
  222. //91 : 77 (年份寬度) + "上下"區塊間的Thickness寬度 10 + 切割該區塊的係數 4
  223. MyBorder newimage = new MyBorder(cutForTwowidth, cutForTwoheight, borderlist[index].Margin.Left, borderlist[index].Margin.Bottom, borderlist[index].Margin.Left + (blockWidth - cutForTwowidth) / 2, borderlist[index].Margin.Bottom + fitValue, StoryBoardTime, randonvalue);
  224. myborderList.Add(newimage);
  225. }
  226. else
  227. {
  228. int fitValue = 103;
  229. if (GlobalFunction.isSolutionUsing4K)
  230. fitValue *= 2;
  231. //97 : 77 (年份寬度) + "上下"區塊間的Thickness寬度 10 + 切割下區塊的係數 (上下) 4 + 往上多飛一個Thickness寬度 5 + 切割該區塊的係數(下) 2
  232. MyBorder newimage = new MyBorder(cutForTwowidth, cutForTwoheight, borderlist[index].Margin.Left, borderlist[index].Margin.Bottom, borderlist[index].Margin.Left + (blockWidth - cutForTwowidth) / 2, borderlist[index].Margin.Bottom + fitValue + (i * cutForTwoheight), StoryBoardTime, randonvalue);
  233. myborderList.Add(newimage);
  234. }
  235. }
  236. }
  237. //如果該年超過兩個事件~則動畫位置
  238. else
  239. {
  240. for (int i = 0; i < xmlDataList[index].monthclassList.Count; i++)
  241. {
  242. int randonvalue = rnd.Next(0, 401);
  243. if (i > 5)
  244. {
  245. break;
  246. }
  247. //排(橫)
  248. int Row = i / 2;
  249. //列(直)
  250. int colu = i % 2;
  251. int thicknessValue = 5;
  252. int fitXvalue = 210;
  253. int fitYvalue = 91;
  254. if (GlobalFunction.isSolutionUsing4K)
  255. {
  256. thicknessValue *= 2;
  257. fitXvalue *= 2;
  258. fitYvalue *= 2;
  259. }
  260. if (Row == 0)
  261. {
  262. if (colu == 0)
  263. {
  264. MyBorder newimage = new MyBorder(cutForSixwidth, cutForSixheight, borderlist[index].Margin.Left, borderlist[index].Margin.Bottom, borderlist[index].Margin.Left + (blockWidth - ((fitXvalue + thicknessValue) * 2)) / 2, borderlist[index].Margin.Bottom + fitYvalue, StoryBoardTime, randonvalue);
  265. myborderList.Add(newimage);
  266. }
  267. else
  268. {
  269. //225 : cutForSixwidth 210 + 該區塊的"左右"的Thickness 10 + 右邊區塊的"左"Thickness 5
  270. MyBorder newimage = new MyBorder(cutForSixwidth, cutForSixheight, borderlist[index].Margin.Left, borderlist[index].Margin.Bottom, borderlist[index].Margin.Left + (blockWidth - ((fitXvalue + thicknessValue) * 2)) / 2 + ((fitXvalue + thicknessValue * 2)), borderlist[index].Margin.Bottom + fitYvalue, StoryBoardTime, randonvalue);
  271. myborderList.Add(newimage);
  272. }
  273. }
  274. else
  275. {
  276. if (colu == 0)
  277. {
  278. //14 : 區塊"上下"的Thickness 10 + 切割該區塊的係數 4
  279. MyBorder newimage = new MyBorder(cutForSixwidth, cutForSixheight, borderlist[index].Margin.Left, borderlist[index].Margin.Bottom, borderlist[index].Margin.Left + (blockWidth - ((fitXvalue + thicknessValue) * 2)) / 2, borderlist[index].Margin.Bottom + fitYvalue + (Row * cutForSixheight) + (11 * Row), StoryBoardTime, randonvalue);
  280. myborderList.Add(newimage);
  281. }
  282. else
  283. {
  284. //225 : cutForSixwidth 210 + 該區塊的"左右"的Thickness 10 + 右邊區塊的"左"Thickness 5
  285. MyBorder newimage = new MyBorder(cutForSixwidth, cutForSixheight, borderlist[index].Margin.Left, borderlist[index].Margin.Bottom, borderlist[index].Margin.Left + (blockWidth - ((fitXvalue + thicknessValue) * 2)) / 2 + (fitXvalue + thicknessValue * 2), borderlist[index].Margin.Bottom + fitYvalue + (Row * cutForSixheight) + (11 * Row), StoryBoardTime, randonvalue);
  286. myborderList.Add(newimage);
  287. }
  288. }
  289. }
  290. }
  291. }
  292. }
  293. #region X 與 Y 軸動畫
  294. private void SetStoryboardMotionX()
  295. {
  296. progressWidthStoryBoard = new Storyboard();
  297. dbOffsetWidth = new DoubleAnimation()
  298. {
  299. Duration = TimeSpan.FromMilliseconds(1000),
  300. EasingFunction = new ExponentialEase()
  301. {
  302. EasingMode = EasingMode.EaseIn,
  303. Exponent = 0.3
  304. },
  305. };
  306. Storyboard.SetTarget(dbOffsetWidth, this.uxProgressBar);
  307. Storyboard.SetTargetProperty(dbOffsetWidth, new PropertyPath(Grid.WidthProperty));
  308. progressWidthStoryBoard.Children.Add(dbOffsetWidth);
  309. progressWidthStoryBoard.Completed += new EventHandler(progressStoryBoard_Completed);
  310. progressWidthStoryBoard.FillBehavior = FillBehavior.HoldEnd;
  311. }
  312. void progressStoryBoard_Completed(object sender, EventArgs e)
  313. {
  314. progressHeightStoryBoard.Begin();
  315. }
  316. public void SetEventCount(int count)
  317. {
  318. eventTotalCount = count;
  319. }
  320. private void SetStoryboardMotionY()
  321. {
  322. progressHeightStoryBoard = new Storyboard();
  323. int aniHeight = 77;
  324. if (GlobalFunction.isSolutionUsing4K)
  325. aniHeight *= 2;
  326. dbOffsetHeight = new DoubleAnimation()
  327. {
  328. Duration = TimeSpan.FromMilliseconds(500),
  329. EasingFunction = new ExponentialEase()
  330. {
  331. EasingMode = EasingMode.EaseIn,
  332. Exponent = 0.3
  333. },
  334. From = this.uxProgressBar.Height,
  335. To = aniHeight,
  336. };
  337. Storyboard.SetTarget(dbOffsetHeight, this.uxProgressBar);
  338. Storyboard.SetTargetProperty(dbOffsetHeight, new PropertyPath(Grid.HeightProperty));
  339. progressHeightStoryBoard.Children.Add(dbOffsetHeight);
  340. progressHeightStoryBoard.Completed += new EventHandler(progressHeightStoryBoard_Completed);
  341. progressHeightStoryBoard.FillBehavior = FillBehavior.HoldEnd;
  342. }
  343. void progressHeightStoryBoard_Completed(object sender, EventArgs e)
  344. {
  345. while (true)
  346. {
  347. if (xmlDataList.Count > 0)
  348. {
  349. for (int i = 0; i < xmlDataList.Count; i++)
  350. {
  351. Border bd = new Border();
  352. TextBlock tb = new TextBlock();
  353. tb.Foreground = TextBlockExtendColor;
  354. tb.FontSize = GlobalFunction.isSolutionUsing4K ? 40 * 1.5 : 40;
  355. tb.TextTrimming = TextTrimming.CharacterEllipsis;
  356. tb.VerticalAlignment = System.Windows.VerticalAlignment.Center;
  357. tb.HorizontalAlignment = System.Windows.HorizontalAlignment.Center;
  358. string langStr = xmlDataList[i].yearlan1;
  359. if (ConfigSettingClass.MainBackCollect.DefaultLangIndex == 1)
  360. {
  361. langStr = xmlDataList[i].yearlan2;
  362. }
  363. else if (ConfigSettingClass.MainBackCollect.DefaultLangIndex == 2)
  364. {
  365. langStr = xmlDataList[i].yearlan3;
  366. }
  367. else if (ConfigSettingClass.MainBackCollect.DefaultLangIndex == 3)
  368. {
  369. langStr = xmlDataList[i].yearlan4;
  370. }
  371. tb.Text = langStr;
  372. bd.Child = tb;
  373. bd.Width = blockWidth;
  374. bd.Height = blockHeight;
  375. bd.BorderThickness = new Thickness(5);
  376. bd.BorderBrush = Brushes.Transparent;
  377. bd.Background = sb;
  378. bd.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
  379. bd.VerticalAlignment = System.Windows.VerticalAlignment.Bottom;
  380. borderlist.Add(bd);
  381. }
  382. break;
  383. }
  384. }
  385. //在整個動畫結束後~代表資料已經載入完成此時才知道顯示在前面個年份是哪幾個~
  386. //設定每個Block的位置
  387. SetBlockPos();
  388. //根據事件的數量~新建出Image並設定其動畫
  389. SetEventAnimation();
  390. //顯示區塊及動畫
  391. ShowBlock();
  392. //設定時間歷史牆啟動
  393. HistoryWallStart();
  394. }
  395. #endregion
  396. //觸發整個動畫起始位置
  397. public void AddLoadCount()
  398. {
  399. eventLoadCount++;
  400. RunProgressStoryboard();
  401. }
  402. private void RunProgressStoryboard()
  403. {
  404. uxLoadingProgress.EndValue = ((double)eventLoadCount / (double)eventTotalCount) * 100d;
  405. }
  406. internal void SetHistoryWallControl(Grid uxCyclicGrid)
  407. {
  408. HistoryWallControl = uxCyclicGrid;
  409. }
  410. }
  411. /// <summary>擴充uiElement類別的方法</summary>
  412. /// <remarks>為uiElement類別增加element即時重整的功能</remarks>
  413. public static class uiElementExtension
  414. {
  415. private static Action NoDoDelegate = delegate () { };
  416. public static void Refresh(this UIElement uiElement)
  417. {
  418. uiElement.Dispatcher.Invoke(DispatcherPriority.Render, NoDoDelegate);
  419. }
  420. public static void WebRefresh(this UIElement uiElement)
  421. {
  422. uiElement.Dispatcher.Invoke(DispatcherPriority.ContextIdle, NoDoDelegate);
  423. }
  424. }
  425. //自訂義Image
  426. public class MyBorder : Border
  427. {
  428. //區塊大小
  429. public int borderwidth;
  430. public int borderheight;
  431. //動畫起始位置
  432. public double beginPosX;
  433. public double beginPosY;
  434. //動畫結束位置
  435. public double endPosX;
  436. public double endPosY;
  437. public Storyboard myborderStoryboard = new Storyboard();
  438. //動畫運行時間
  439. public int storyboardTime;
  440. //動畫的Delay time 讓整個飛入的物件不會同時飛
  441. public int storyboardBeginTime;
  442. private SolidColorBrush RotateContainColor = new SolidColorBrush(ConfigSettingClass.EventCollect.BackgroundColor);
  443. public MyBorder(int width, int height, double bPosX, double bPosY, double ePosX, double ePosY, int StoryboardTime, int STbeginTime)
  444. {
  445. borderwidth = width;
  446. borderheight = height;
  447. beginPosX = bPosX;
  448. beginPosY = bPosY;
  449. endPosX = ePosX;
  450. endPosY = ePosY;
  451. storyboardTime = StoryboardTime;
  452. storyboardBeginTime = STbeginTime;
  453. this.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
  454. this.VerticalAlignment = System.Windows.VerticalAlignment.Bottom;
  455. this.Background = RotateContainColor;
  456. this.BorderThickness = new Thickness(0);
  457. this.Opacity = 0;
  458. SetTheFlyStoryboard();
  459. }
  460. public void FlyAnimationStart()
  461. {
  462. this.Opacity = 1;
  463. myborderStoryboard.Begin();
  464. }
  465. //飛入的動畫
  466. private void SetTheFlyStoryboard()
  467. {
  468. ThicknessAnimation dbOffset = new ThicknessAnimation()
  469. {
  470. Duration = TimeSpan.FromMilliseconds(storyboardTime),
  471. EasingFunction = new CircleEase()
  472. {
  473. EasingMode = EasingMode.EaseOut,
  474. },
  475. From = new Thickness(beginPosX, 0, 0, beginPosY),
  476. To = new Thickness(endPosX, 0, 0, endPosY)
  477. };
  478. DoubleAnimation dbOffsetWidth = new DoubleAnimation()
  479. {
  480. Duration = TimeSpan.FromMilliseconds(storyboardTime),
  481. EasingFunction = new CircleEase()
  482. {
  483. EasingMode = EasingMode.EaseOut,
  484. },
  485. From = 0,
  486. To = borderwidth
  487. };
  488. DoubleAnimation dbOffsetHeight = new DoubleAnimation()
  489. {
  490. Duration = TimeSpan.FromMilliseconds(storyboardTime),
  491. EasingFunction = new CircleEase()
  492. {
  493. EasingMode = EasingMode.EaseOut,
  494. },
  495. From = 0,
  496. To = borderheight
  497. };
  498. DoubleAnimation dbOffsetOpacity = new DoubleAnimation()
  499. {
  500. Duration = TimeSpan.FromMilliseconds(storyboardTime),
  501. EasingFunction = new CircleEase()
  502. {
  503. EasingMode = EasingMode.EaseOut,
  504. },
  505. From = 0,
  506. To = 1
  507. };
  508. Storyboard.SetTarget(dbOffset, this);
  509. Storyboard.SetTarget(dbOffsetWidth, this);
  510. Storyboard.SetTarget(dbOffsetHeight, this);
  511. Storyboard.SetTarget(dbOffsetOpacity, this);
  512. Storyboard.SetTargetProperty(dbOffset, new PropertyPath(Border.MarginProperty));
  513. Storyboard.SetTargetProperty(dbOffsetWidth, new PropertyPath(Border.WidthProperty));
  514. Storyboard.SetTargetProperty(dbOffsetHeight, new PropertyPath(Border.HeightProperty));
  515. Storyboard.SetTargetProperty(dbOffsetOpacity, new PropertyPath(Border.OpacityProperty));
  516. myborderStoryboard.BeginTime = TimeSpan.FromMilliseconds(storyboardBeginTime);
  517. myborderStoryboard.Children.Add(dbOffset);
  518. myborderStoryboard.Children.Add(dbOffsetWidth);
  519. myborderStoryboard.Children.Add(dbOffsetHeight);
  520. myborderStoryboard.Children.Add(dbOffsetOpacity);
  521. myborderStoryboard.FillBehavior = FillBehavior.HoldEnd;
  522. }
  523. }
  524. }