/// <summary> /// Initializes a new instance of the <see cref="HoverPopup"/> class and sets up its child UI elements. /// </summary> /// <param name="hoverObject">The hover object.</param> /// <param name="artifactViewer">The artifact viewer.</param> internal HoverPopup(HoverObject hoverObject, ArtifactViewer artifactViewer) { this.hoverObject = hoverObject; this.artifactViewer = artifactViewer; this.StaysOpen = false; this.AllowsTransparency = true; this.Placement = PlacementMode.Mouse; this.PopupAnimation = PopupAnimation.Fade; this.MaxWidth = 300; this.MouseMove += this.HoverPopupMouseMove; this.awayTimer = new DispatcherTimer(); this.awayTimer.Interval = TimeSpan.FromMilliseconds(50); this.awayTimer.Tick += this.AwayTimerTick; this.layoutGrid = new Grid(); this.layoutGrid.Margin = new Thickness(0, 0, 8, 8); this.Child = this.layoutGrid; DropShadowBitmapEffect dropShadowEffect = new DropShadowBitmapEffect(); dropShadowEffect.ShadowDepth = 5; this.layoutGrid.BitmapEffect = dropShadowEffect; Border border = new Border(); border.Background = Brushes.White; border.Padding = new Thickness(5); border.CornerRadius = new CornerRadius(5); this.layoutGrid.Children.Add(border); this.layoutStackPanel = new StackPanel(); border.Child = this.layoutStackPanel; this.AddTitle(); }
private static void DirectionPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { DropShadowBitmapEffect target = ((DropShadowBitmapEffect)d); target.PropertyChanged(DirectionProperty); }
public static Se.DropShadowBitmapEffect ToMediaBitmapEffect(this Wg.ShadowEffect input) { Se.DropShadowBitmapEffect output = new Se.DropShadowBitmapEffect(); output.Color = input.Color.ToMediaColor(); output.Opacity = input.Color.A / 255.0; output.Softness = input.Radius; output.Direction = input.Angle; output.ShadowDepth = input.Distance; return(output); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: #line 9 "..\..\..\..\Views\Game2\Round6.xaml" ((PuzzleGame.Views.Game2.Round6)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded); #line default #line hidden return; case 2: this.cnBoard = ((System.Windows.Controls.Canvas)(target)); return; case 3: this.step1 = ((System.Windows.Controls.Button)(target)); #line 139 "..\..\..\..\Views\Game2\Round6.xaml" this.step1.Click += new System.Windows.RoutedEventHandler(this.getHint); #line default #line hidden return; case 4: this.imgstep1 = ((System.Windows.Media.ImageBrush)(target)); return; case 5: this.step2 = ((System.Windows.Controls.Button)(target)); #line 147 "..\..\..\..\Views\Game2\Round6.xaml" this.step2.Click += new System.Windows.RoutedEventHandler(this.rePlay); #line default #line hidden return; case 6: this.imgstep2 = ((System.Windows.Media.ImageBrush)(target)); return; case 7: this.canvas1 = ((System.Windows.Controls.Canvas)(target)); return; case 8: this.back = ((System.Windows.Controls.Button)(target)); #line 176 "..\..\..\..\Views\Game2\Round6.xaml" this.back.Click += new System.Windows.RoutedEventHandler(this.back_Click); #line default #line hidden return; case 9: this.img1 = ((System.Windows.Controls.Image)(target)); #line 179 "..\..\..\..\Views\Game2\Round6.xaml" this.img1.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.Feast_MouseDown); #line default #line hidden #line 179 "..\..\..\..\Views\Game2\Round6.xaml" this.img1.MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.Feast_MouseUp); #line default #line hidden #line 179 "..\..\..\..\Views\Game2\Round6.xaml" this.img1.MouseMove += new System.Windows.Input.MouseEventHandler(this.Feast_MouseMove); #line default #line hidden return; case 10: this.shadow1 = ((System.Windows.Media.Effects.DropShadowBitmapEffect)(target)); return; case 11: this.img2 = ((System.Windows.Controls.Image)(target)); #line 195 "..\..\..\..\Views\Game2\Round6.xaml" this.img2.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.Feast_MouseDown); #line default #line hidden #line 195 "..\..\..\..\Views\Game2\Round6.xaml" this.img2.MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.Feast_MouseUp); #line default #line hidden #line 195 "..\..\..\..\Views\Game2\Round6.xaml" this.img2.MouseMove += new System.Windows.Input.MouseEventHandler(this.Feast_MouseMove); #line default #line hidden return; case 12: this.shadow2 = ((System.Windows.Media.Effects.DropShadowBitmapEffect)(target)); return; case 13: this.img3 = ((System.Windows.Controls.Image)(target)); #line 208 "..\..\..\..\Views\Game2\Round6.xaml" this.img3.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.Feast_MouseDown); #line default #line hidden #line 208 "..\..\..\..\Views\Game2\Round6.xaml" this.img3.MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.Feast_MouseUp); #line default #line hidden #line 208 "..\..\..\..\Views\Game2\Round6.xaml" this.img3.MouseMove += new System.Windows.Input.MouseEventHandler(this.Feast_MouseMove); #line default #line hidden return; case 14: this.shadow3 = ((System.Windows.Media.Effects.DropShadowBitmapEffect)(target)); return; case 15: this.img4 = ((System.Windows.Controls.Image)(target)); #line 221 "..\..\..\..\Views\Game2\Round6.xaml" this.img4.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.Feast_MouseDown); #line default #line hidden #line 221 "..\..\..\..\Views\Game2\Round6.xaml" this.img4.MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.Feast_MouseUp); #line default #line hidden #line 221 "..\..\..\..\Views\Game2\Round6.xaml" this.img4.MouseMove += new System.Windows.Input.MouseEventHandler(this.Feast_MouseMove); #line default #line hidden return; case 16: this.shadow4 = ((System.Windows.Media.Effects.DropShadowBitmapEffect)(target)); return; case 17: this.img5 = ((System.Windows.Controls.Image)(target)); #line 234 "..\..\..\..\Views\Game2\Round6.xaml" this.img5.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.Feast_MouseDown); #line default #line hidden #line 234 "..\..\..\..\Views\Game2\Round6.xaml" this.img5.MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.Feast_MouseUp); #line default #line hidden #line 234 "..\..\..\..\Views\Game2\Round6.xaml" this.img5.MouseMove += new System.Windows.Input.MouseEventHandler(this.Feast_MouseMove); #line default #line hidden return; case 18: this.shadow5 = ((System.Windows.Media.Effects.DropShadowBitmapEffect)(target)); return; case 19: this.img6 = ((System.Windows.Controls.Image)(target)); #line 247 "..\..\..\..\Views\Game2\Round6.xaml" this.img6.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.Feast_MouseDown); #line default #line hidden #line 247 "..\..\..\..\Views\Game2\Round6.xaml" this.img6.MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.Feast_MouseUp); #line default #line hidden #line 247 "..\..\..\..\Views\Game2\Round6.xaml" this.img6.MouseMove += new System.Windows.Input.MouseEventHandler(this.Feast_MouseMove); #line default #line hidden return; case 20: this.shadow6 = ((System.Windows.Media.Effects.DropShadowBitmapEffect)(target)); return; case 21: this.img7 = ((System.Windows.Controls.Image)(target)); #line 260 "..\..\..\..\Views\Game2\Round6.xaml" this.img7.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.Feast_MouseDown); #line default #line hidden #line 260 "..\..\..\..\Views\Game2\Round6.xaml" this.img7.MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.Feast_MouseUp); #line default #line hidden #line 260 "..\..\..\..\Views\Game2\Round6.xaml" this.img7.MouseMove += new System.Windows.Input.MouseEventHandler(this.Feast_MouseMove); #line default #line hidden return; case 22: this.shadow7 = ((System.Windows.Media.Effects.DropShadowBitmapEffect)(target)); return; case 23: this.img8 = ((System.Windows.Controls.Image)(target)); #line 273 "..\..\..\..\Views\Game2\Round6.xaml" this.img8.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.Feast_MouseDown); #line default #line hidden #line 273 "..\..\..\..\Views\Game2\Round6.xaml" this.img8.MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.Feast_MouseUp); #line default #line hidden #line 273 "..\..\..\..\Views\Game2\Round6.xaml" this.img8.MouseMove += new System.Windows.Input.MouseEventHandler(this.Feast_MouseMove); #line default #line hidden return; case 24: this.shadow8 = ((System.Windows.Media.Effects.DropShadowBitmapEffect)(target)); return; case 25: this.img9 = ((System.Windows.Controls.Image)(target)); #line 286 "..\..\..\..\Views\Game2\Round6.xaml" this.img9.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.Feast_MouseDown); #line default #line hidden #line 286 "..\..\..\..\Views\Game2\Round6.xaml" this.img9.MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.Feast_MouseUp); #line default #line hidden #line 286 "..\..\..\..\Views\Game2\Round6.xaml" this.img9.MouseMove += new System.Windows.Input.MouseEventHandler(this.Feast_MouseMove); #line default #line hidden return; case 26: this.shadow9 = ((System.Windows.Media.Effects.DropShadowBitmapEffect)(target)); return; case 27: this.img10 = ((System.Windows.Controls.Image)(target)); #line 299 "..\..\..\..\Views\Game2\Round6.xaml" this.img10.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.Feast_MouseDown); #line default #line hidden #line 299 "..\..\..\..\Views\Game2\Round6.xaml" this.img10.MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.Feast_MouseUp); #line default #line hidden #line 299 "..\..\..\..\Views\Game2\Round6.xaml" this.img10.MouseMove += new System.Windows.Input.MouseEventHandler(this.Feast_MouseMove); #line default #line hidden return; case 28: this.shadow10 = ((System.Windows.Media.Effects.DropShadowBitmapEffect)(target)); return; case 29: this.img11 = ((System.Windows.Controls.Image)(target)); #line 312 "..\..\..\..\Views\Game2\Round6.xaml" this.img11.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.Feast_MouseDown); #line default #line hidden #line 312 "..\..\..\..\Views\Game2\Round6.xaml" this.img11.MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.Feast_MouseUp); #line default #line hidden #line 312 "..\..\..\..\Views\Game2\Round6.xaml" this.img11.MouseMove += new System.Windows.Input.MouseEventHandler(this.Feast_MouseMove); #line default #line hidden return; case 30: this.shadow11 = ((System.Windows.Media.Effects.DropShadowBitmapEffect)(target)); return; case 31: this.img12 = ((System.Windows.Controls.Image)(target)); #line 325 "..\..\..\..\Views\Game2\Round6.xaml" this.img12.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.Feast_MouseDown); #line default #line hidden #line 325 "..\..\..\..\Views\Game2\Round6.xaml" this.img12.MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.Feast_MouseUp); #line default #line hidden #line 325 "..\..\..\..\Views\Game2\Round6.xaml" this.img12.MouseMove += new System.Windows.Input.MouseEventHandler(this.Feast_MouseMove); #line default #line hidden return; case 32: this.shadow12 = ((System.Windows.Media.Effects.DropShadowBitmapEffect)(target)); return; case 33: this.img13 = ((System.Windows.Controls.Image)(target)); #line 338 "..\..\..\..\Views\Game2\Round6.xaml" this.img13.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.Feast_MouseDown); #line default #line hidden #line 338 "..\..\..\..\Views\Game2\Round6.xaml" this.img13.MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.Feast_MouseUp); #line default #line hidden #line 338 "..\..\..\..\Views\Game2\Round6.xaml" this.img13.MouseMove += new System.Windows.Input.MouseEventHandler(this.Feast_MouseMove); #line default #line hidden return; case 34: this.shadow13 = ((System.Windows.Media.Effects.DropShadowBitmapEffect)(target)); return; case 35: this.img14 = ((System.Windows.Controls.Image)(target)); #line 351 "..\..\..\..\Views\Game2\Round6.xaml" this.img14.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.Feast_MouseDown); #line default #line hidden #line 351 "..\..\..\..\Views\Game2\Round6.xaml" this.img14.MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.Feast_MouseUp); #line default #line hidden #line 351 "..\..\..\..\Views\Game2\Round6.xaml" this.img14.MouseMove += new System.Windows.Input.MouseEventHandler(this.Feast_MouseMove); #line default #line hidden return; case 36: this.shadow14 = ((System.Windows.Media.Effects.DropShadowBitmapEffect)(target)); return; case 37: this.img15 = ((System.Windows.Controls.Image)(target)); #line 364 "..\..\..\..\Views\Game2\Round6.xaml" this.img15.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.Feast_MouseDown); #line default #line hidden #line 364 "..\..\..\..\Views\Game2\Round6.xaml" this.img15.MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.Feast_MouseUp); #line default #line hidden #line 364 "..\..\..\..\Views\Game2\Round6.xaml" this.img15.MouseMove += new System.Windows.Input.MouseEventHandler(this.Feast_MouseMove); #line default #line hidden return; case 38: this.shadow15 = ((System.Windows.Media.Effects.DropShadowBitmapEffect)(target)); return; case 39: this.img16 = ((System.Windows.Controls.Image)(target)); #line 377 "..\..\..\..\Views\Game2\Round6.xaml" this.img16.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.Feast_MouseDown); #line default #line hidden #line 377 "..\..\..\..\Views\Game2\Round6.xaml" this.img16.MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.Feast_MouseUp); #line default #line hidden #line 377 "..\..\..\..\Views\Game2\Round6.xaml" this.img16.MouseMove += new System.Windows.Input.MouseEventHandler(this.Feast_MouseMove); #line default #line hidden return; case 40: this.shadow16 = ((System.Windows.Media.Effects.DropShadowBitmapEffect)(target)); return; case 41: this.bantay = ((System.Windows.Controls.StackPanel)(target)); #line 395 "..\..\..\..\Views\Game2\Round6.xaml" this.bantay.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.bantay_MouseDown); #line default #line hidden return; case 42: this.AnimatedTranslateTransform = ((System.Windows.Media.TranslateTransform)(target)); return; case 43: this.gethint = ((System.Windows.Controls.Grid)(target)); return; case 44: this.bodertimeout = ((System.Windows.Controls.Border)(target)); return; case 45: this.anhgoc = ((System.Windows.Controls.Image)(target)); return; case 46: this.uc = ((System.Windows.Controls.Grid)(target)); return; } this._contentLoaded = true; }
/// <summary> /// Shadow Effect but deprecated /// </summary> public static DropShadowBitmapEffect OldShadowEffect() { //Create Shadow Effect DropShadowBitmapEffect ShadowEffect = new DropShadowBitmapEffect(); ShadowEffect.Color = Colors.Black; ShadowEffect.Direction = 320; ShadowEffect.Opacity = 0.5; ShadowEffect.Softness = 1; ShadowEffect.ShadowDepth = 15; return ShadowEffect; }
public static DropShadowBitmapEffect getShadowEffect() { DropShadowBitmapEffect shadowEffect = new DropShadowBitmapEffect(); System.Windows.Media.Color myShadowColor = new System.Windows.Media.Color(); myShadowColor.ScA = 1; myShadowColor.ScR = 0; myShadowColor.ScG = 0; myShadowColor.ScB = 0; shadowEffect.Color = myShadowColor; shadowEffect.Direction = 320; shadowEffect.ShadowDepth = 10; shadowEffect.Softness = 1; shadowEffect.Opacity = 0.3; return shadowEffect; }
//该函数能够画出一个书库的背景图片,包含书架,轮廓和门,参数为该图书馆名称,参数即为Map表中的location字段 public void drawLibraryShelfMapBackgroundByLibraryName(String libraryName) { String libraryNameInTable = this.bookLocationStringToLibraryName(libraryName); //获取图书位置信息数据库的引用 IBookLocationService bookLocationService = this.container.Resolve<IBookLocationService>(); //画出书库的地板,重复画出 /*** BitmapImage floorTileBitmapImage = new BitmapImage(); floorTileBitmapImage.BeginInit(); floorTileBitmapImage.UriSource = new Uri("pack://application:,,,/UI;component/Resource/images/glass.png", UriKind.RelativeOrAbsolute); floorTileBitmapImage.EndInit(); this.libraryShelfDrawer.drawFloor(floorTileBitmapImage); ***/ //画出所有的书架 try { //获取某个书库中所有的书架 List<String> shelfPositionStringList = bookLocationService.getItemPositionStringListByLocationAndType(libraryNameInTable, "SHELF"); //从数据库中读到的字符串列表中解析出所有的书架地理位置信息,并加入到this.shelfMapShelfList中 List<ShelfShape> shelfMapShelfList = new List<ShelfShape>(); foreach (String stringItem in shelfPositionStringList) {//stringItem is a string ,such as "13000,1500,1500,1000",startpoint x,y,and width,height char[] separator = { ',', ',' }; String[] pointDescInString = stringItem.Split(separator); if (pointDescInString.Length != 4) { continue; } //如果不为4个数字,则意味着可能出现了解析或者存储错误 double[] pointDescInDouble = new double[] { Convert.ToDouble(pointDescInString[0]), Convert.ToDouble(pointDescInString[1]), Convert.ToDouble(pointDescInString[2]), Convert.ToDouble(pointDescInString[3]) }; Point leftTop = new Point(pointDescInDouble[0], pointDescInDouble[1]); Point rightBottom = new Point(pointDescInDouble[0] + pointDescInDouble[2], pointDescInDouble[1] + pointDescInDouble[3]); //把书架的位置信息放入结构体的变量中shelfMapShelfList shelfMapShelfList.Add(new ShelfShape(leftTop, rightBottom)); } //开始绘制俯视图中的书架 BitmapImage bitmapImage = new BitmapImage(); //Uri uri = new Uri("pack://application:,,,/UI;component/Resource/images/oneShelf.png", UriKind.RelativeOrAbsolute); bitmapImage.BeginInit(); bitmapImage.UriSource = new Uri("pack://application:,,,/UI;component/Resource/images/oneShelf.png", UriKind.RelativeOrAbsolute); bitmapImage.EndInit(); //设置旋转效果和阴影效果,开始 RotateTransform rotateTransform = new RotateTransform(0); DropShadowBitmapEffect bitmapEffect = new DropShadowBitmapEffect(); Color ShadowColor = new Color(); ShadowColor.ScA = 1;ShadowColor.ScB = 0;ShadowColor.ScG = 0;ShadowColor.ScR = 0; bitmapEffect.Color = ShadowColor; bitmapEffect.Direction = 320; bitmapEffect.ShadowDepth = 10; bitmapEffect.Softness = 0.1; bitmapEffect.Opacity = 0.1; //设置选择效果和阴影效果,结束 foreach (ShelfShape oneShelf in shelfMapShelfList) { //原始代码是绘制矩形框,现在改为绘制图片 //this.libraryShelfDrawer.drawShelf(oneShelf.topLeft, oneShelf.bottomRight); this.libraryShelfDrawer.drawImage(oneShelf.topLeft, oneShelf.bottomRight, bitmapImage, rotateTransform, bitmapEffect); } } catch (Exception) { this.eventAggregator.GetEvent<DatabaseEvent>().Publish("DrawMapService:从数据库中获取书架信息出错!"); //如果发生错误那发布事件 } //画出某个书库的轮廓 try { List<String> shelfContourPostionStringList = bookLocationService.getItemPositionStringListByLocationAndType(libraryNameInTable, "CONTOUR"); String shelfContourPostionString = ""; ContourShape shelfMapContour ; //轮廓信息存放的地点 //如果获得的轮廓个数小于零,则说明数据出现了问题.其实一个书库的轮廓只能有一个 if (shelfContourPostionStringList.Count > 0) { shelfContourPostionString = shelfContourPostionStringList[0]; char[] separator = { ',', ',' }; String[] pointDescInString = shelfContourPostionString.Split(separator); //轮廓点的个数只能是偶数个,如果解析和读取数据的时候出现任何错误,则花图书轮廓的程序终止 if ((pointDescInString.Length % 2 == 0) && (pointDescInString.Length >= 2)) { List<Double> pointXList = new List<Double>(); List<Double> pointYList = new List<Double>(); for (int i = 0; i < pointDescInString.Length; i = i + 2) { pointXList.Add(Convert.ToDouble(pointDescInString[i])); pointYList.Add(Convert.ToDouble(pointDescInString[i + 1])); } if (pointXList.Count == pointYList.Count) { List<Point> contourPointList = new List<Point>(); for (int i = 0; i < pointXList.Count(); i++) { Point onePoint = new Point(pointXList[i], pointYList[i]); contourPointList.Add(onePoint); } shelfMapContour = new ContourShape(contourPointList); this.libraryShelfDrawer.drawContour(shelfMapContour.pointList); } } } }catch(Exception) { this.eventAggregator.GetEvent<DatabaseEvent>().Publish("DrawMapService:从数据库中获取书库轮廓信息出错!"); //如果发生错误那发布事件 } //画出某个书库大门的位置 try { List<String> doorPostionStringList = bookLocationService.getItemPositionStringListByLocationAndType(libraryNameInTable, "DOOR"); DoorShape shelfMapDoor;//入口信息存放的位置 if (doorPostionStringList.Count > 0) { String doorPostionString = doorPostionStringList[0]; char[] separator = { ',', ',' }; String[] pointDescInString = doorPostionString.Split(separator); if (pointDescInString.Length == 4) { double[] pointDescInDouble = new double[] { Convert.ToDouble(pointDescInString[0]), Convert.ToDouble(pointDescInString[1]), Convert.ToDouble(pointDescInString[2]), Convert.ToDouble(pointDescInString[3]) }; Point leftTop = new Point(pointDescInDouble[0], pointDescInDouble[1]); Point rightBottom = new Point(pointDescInDouble[0] + pointDescInDouble[2], pointDescInDouble[1] + pointDescInDouble[3]); //把书库大门的位置信息放入结构体的变量中shelfMapShelfList shelfMapDoor = new DoorShape(leftTop, rightBottom); //载入入口图片 BitmapImage bitmapImage = new BitmapImage(); bitmapImage.BeginInit(); bitmapImage.UriSource = new Uri("pack://application:,,,/UI;component/Resource/images/door.png", UriKind.RelativeOrAbsolute); bitmapImage.EndInit(); //设置旋转效果和阴影效果,开始 RotateTransform rotateTransform = new RotateTransform(0); DropShadowBitmapEffect bitmapEffect = new DropShadowBitmapEffect(); //this.libraryShelfDrawer.drawDoor(shelfMapDoor.topLeft, shelfMapDoor.bottomRight); this.libraryShelfDrawer.drawImage(shelfMapDoor.topLeft, shelfMapDoor.bottomRight, bitmapImage, rotateTransform, bitmapEffect); } } } catch (Exception) { this.eventAggregator.GetEvent<DatabaseEvent>().Publish("DrawMapService:从数据库中获取书库大门信息出错!"); //如果发生错误那发布事件 } }
public void StartDrag() { //Break Canvas bindings SetContainerCanvasBindings(SetBindingMode.ClearBinding); //Create DropShadow DropShadowBitmapEffect dps = new DropShadowBitmapEffect(); dps.SetValue(NameProperty, "dps"); dps.Softness = 1; dps.ShadowDepth = 0; this.sContainer.BitmapEffect = dps; this.sContainer.RegisterName(dps.GetValue(NameProperty).ToString(), dps); //Resize Window this.Height += 10; this.Width += 10; //Create animation DoubleAnimation animShowDropShadow = new DoubleAnimation(0, 5, TimeSpan.FromMilliseconds(100)); Storyboard.SetTargetName(animShowDropShadow, dps.GetValue(NameProperty).ToString()); Storyboard.SetTargetProperty(animShowDropShadow, new PropertyPath(DropShadowBitmapEffect.ShadowDepthProperty)); Storyboard storyShowDrop = new Storyboard(); storyShowDrop.Children.Add(animShowDropShadow); storyShowDrop.Begin(this.sContainer); this.DragMove(); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.cm = ((System.Windows.Controls.ContextMenu)(target)); return; case 2: #line 18 "..\..\ClockWindow.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.Shadow_0); #line default #line hidden return; case 3: #line 19 "..\..\ClockWindow.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.Shadow_1); #line default #line hidden return; case 4: #line 20 "..\..\ClockWindow.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.Shadow_2); #line default #line hidden return; case 5: #line 21 "..\..\ClockWindow.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.Shadow_3); #line default #line hidden return; case 6: #line 22 "..\..\ClockWindow.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.Shadow_4); #line default #line hidden return; case 7: #line 23 "..\..\ClockWindow.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.Shadow_5); #line default #line hidden return; case 8: this.ClockGrid = ((System.Windows.Controls.Grid)(target)); return; case 9: this.viewport3D1 = ((System.Windows.Controls.Viewport3D)(target)); return; case 10: this.DigitDropShadow = ((System.Windows.Media.Effects.DropShadowBitmapEffect)(target)); return; case 11: this.PCamera_clock1 = ((System.Windows.Media.Media3D.PerspectiveCamera)(target)); return; case 12: this.ModelVisual3D_10h = ((System.Windows.Media.Media3D.ModelVisual3D)(target)); return; case 13: this.AmbientLightContainer_10h = ((System.Windows.Media.Media3D.ModelVisual3D)(target)); return; case 14: this.AmbLight_10h = ((System.Windows.Media.Media3D.AmbientLight)(target)); return; case 15: this.DirectionalLightContainer_10h = ((System.Windows.Media.Media3D.ModelVisual3D)(target)); return; case 16: this.DirectionalLight_10h = ((System.Windows.Media.Media3D.DirectionalLight)(target)); return; case 17: this.ModelVisual3D_1m = ((System.Windows.Media.Media3D.ModelVisual3D)(target)); return; case 18: this.DefaultGroup_1m = ((System.Windows.Media.Media3D.ModelVisual3D)(target)); return; case 19: this.GeometryModel3DGeometry_1m = ((System.Windows.Media.Media3D.GeometryModel3D)(target)); #line 779 "..\..\ClockWindow.xaml" this.GeometryModel3DGeometry_1m.Changed += new System.EventHandler(this.GeometryModel3D_1mChanged); #line default #line hidden return; case 20: this.ModelVisual3D_10s = ((System.Windows.Media.Media3D.ModelVisual3D)(target)); return; case 21: this.DefaultGroup_10s = ((System.Windows.Media.Media3D.ModelVisual3D)(target)); return; case 22: this.GeometryModel3DGeometry_10s = ((System.Windows.Media.Media3D.GeometryModel3D)(target)); #line 808 "..\..\ClockWindow.xaml" this.GeometryModel3DGeometry_10s.Changed += new System.EventHandler(this.GeometryModel3D_10sChanged); #line default #line hidden return; case 23: this.ModelVisual3D_1s = ((System.Windows.Media.Media3D.ModelVisual3D)(target)); return; case 24: this.DefaultGroup_1s = ((System.Windows.Media.Media3D.ModelVisual3D)(target)); return; case 25: this.GeometryModel3DGeometry_1s = ((System.Windows.Media.Media3D.GeometryModel3D)(target)); #line 837 "..\..\ClockWindow.xaml" this.GeometryModel3DGeometry_1s.Changed += new System.EventHandler(this.GeometryModel3D_1sChanged); #line default #line hidden return; case 26: this.ModelVisual3D_div1 = ((System.Windows.Media.Media3D.ModelVisual3D)(target)); return; case 27: this.DefaultGroup_div1 = ((System.Windows.Media.Media3D.ModelVisual3D)(target)); return; case 28: this.GeometryModel3DGeometry_div1 = ((System.Windows.Media.Media3D.GeometryModel3D)(target)); #line 866 "..\..\ClockWindow.xaml" this.GeometryModel3DGeometry_div1.Changed += new System.EventHandler(this.GeometryModel3D_10sChanged); #line default #line hidden return; } this._contentLoaded = true; }
/// <summary> /// Initializes a new instance of the <see cref="MainWindow"/> class. /// </summary> public MainWindow() { this.InitializeComponent(); win.Width = System.Windows.SystemParameters.PrimaryScreenWidth; win.Height = System.Windows.SystemParameters.PrimaryScreenHeight; // initialize the sensor chooser and UI this.sensorChooser = new KinectSensorChooser(); this.sensorChooser.KinectChanged += SensorChooserOnKinectChanged; this.sensorChooserUi.KinectSensorChooser = this.sensorChooser; this.sensorChooser.Start(); // Bind the sensor chooser's current sensor to the KinectRegion var regionSensorBinding = new Binding("Kinect") { Source = this.sensorChooser }; BindingOperations.SetBinding(this.kinectRegion, KinectRegion.KinectSensorProperty, regionSensorBinding); BindingOperations.SetBinding(this.kinectRegion1, KinectRegion.KinectSensorProperty, regionSensorBinding); BindingOperations.SetBinding(this.kinectRegion2, KinectRegion.KinectSensorProperty, regionSensorBinding); BindingOperations.SetBinding(this.kinectRegion3, KinectRegion.KinectSensorProperty, regionSensorBinding); destFileName = Settings.Default.DestinationFile; cnvPuzzle.MouseLeftButtonUp += new MouseButtonEventHandler(cnvPuzzle_MouseLeftButtonUp); cnvPuzzle.MouseDown += new MouseButtonEventHandler(cnvPuzzle_MouseDown); cnvPuzzle.MouseMove += new MouseEventHandler(cnvPuzzle_MouseMove); cnvPuzzle.MouseWheel += new MouseWheelEventHandler(cnvPuzzle_MouseWheel); cnvPuzzle.MouseEnter += new MouseEventHandler(cnvPuzzle_MouseEnter); cnvPuzzle.MouseLeave += new MouseEventHandler(cnvPuzzle_MouseLeave); shadowEffect = new DropShadowBitmapEffect() { Color = Colors.Black, Direction = 320, ShadowDepth = 25, Softness = 1, Opacity = 0.5 }; dispatcherTimer = new DispatcherTimer(); dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick); dispatcherTimer.Interval = new TimeSpan(0, 0, 1); }