资源简介
private void SetPopupPosition()
{
if (colorBoard != null && Application.Current != null && Application.Current.Host != null && Application.Current.Host.Content != null)
{
double contentheight = Application.Current.Host.Content.ActualHeight;
double contentwidth = Application.Current.Host.Content.ActualWidth;
double colorboardheight = colorBoard.ActualHeight;
double colorboardwidth = colorBoard.ActualWidth;
double pickerheight = ActualHeight;
double pickerwidth = ActualWidth;
if (rootElement != null)
{
GeneralTransform transform = rootElement.TransformToVisual(null);
if (transform != null)
{
Point point00 = transform.Transform( new Point(0.0, 0.0));
Point point10 = transform.Transform( new Point(1.0, 0.0));
Point point01 = transform.Transform( new Point(0.0, 1.0));
double x00 = point00.X;
double y00 = point00.Y;
double x = x00;
double y = y00 pickerheight;
if (contentheight < (y colorboardheight))
{
y = y00 - colorboardheight;
}
if (contentwidth < (x colorboardwidth))
{
x = x00 pickerwidth - colorboardwidth;
}
popupDropDown.HorizontalOffset = 0.0;
popupDropDown.VerticalOffset = 0.0;
canvasOutsidePopup.Width = contentwidth;
canvasOutsidePopup.Height = contentheight;
colorBoard.HorizontalAlignment = HorizontalAlignment.Left;
colorBoard.VerticalAlignment = VerticalAlignment.Top;
Canvas.SetLeft(colorBoard, x - x00);
Canvas.SetTop(colorBoard, y - y00);
Matrix identity = Matrix.Identity;
identity.M11 = point10.X - point00.X;
identity.M12 = point10.Y - point00.Y;
identity.M21 = point01.X - point00.X;
identity.M22 = point01.Y - point00.Y;
identity.OffsetX = point00.X;
identity.OffsetY = point00.Y;
MatrixTransform matrixtransform = new MatrixTransform();
InvertMatrix(ref identity);
matrixtransform.Matrix = identity;
canvasOutsidePopup.RenderTransform = matrixtransform;
}
}
}
}
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
namespace SilverlightControls
{
public partial class App : Application
{
public App()
{
this.Startup += this.Application_Startup;
this.Exit += this.Application_Exit;
this.UnhandledException += this.Application_UnhandledException;
InitializeComponent();
}
private void Application_Startup(object sender StartupEventArgs e)
{
this.RootVisual = new MainPage();
}
private void Application_Exit(object sender EventArgs e)
{
}
private void Application_UnhandledException(object sender ApplicationUnhandledExceptionEvent
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2010-12-30 14:06 SilverlightControls\
文件 302 2010-12-08 14:17 SilverlightControls\App.xaml
文件 2409 2010-12-08 14:17 SilverlightControls\App.xaml.cs
目录 0 2010-12-30 11:06 SilverlightControls\ColorPicker\
文件 18520 2010-12-16 15:45 SilverlightControls\ColorPicker\ColorBoard.cs
文件 6093 2010-12-10 10:35 SilverlightControls\ColorPicker\ColorHelper.cs
文件 9126 2010-12-16 15:42 SilverlightControls\ColorPicker\ColorPicker.cs
文件 28497 2010-12-13 17:30 SilverlightControls\ColorPicker\PredefinedColor.cs
文件 4639 2010-12-14 16:09 SilverlightControls\ColorPicker\PredefinedColorItem.cs
文件 3773 2010-12-18 14:52 SilverlightControls\MainPage.xaml
文件 846 2010-12-25 13:57 SilverlightControls\MainPage.xaml.cs
目录 0 2010-12-30 14:05 SilverlightControls\Properties\
文件 207 2010-12-08 14:17 SilverlightControls\Properties\AppManifest.xm
文件 1427 2010-12-08 14:17 SilverlightControls\Properties\AssemblyInfo.cs
文件 5449 2010-12-25 13:49 SilverlightControls\SilverlightControls.csproj
文件 927 2010-12-08 14:17 SilverlightControls\SilverlightControls.sln
文件 16896 2010-12-30 14:06 SilverlightControls\SilverlightControls.suo
目录 0 2010-12-30 11:06 SilverlightControls\Themes\
文件 45979 2010-12-16 15:54 SilverlightControls\Themes\Generic.xaml
文件 191 2010-12-12 14:02 SilverlightControls\Themes\Transparent.PNG
相关资源
- adsl 自动拨号类 源码
- Hosts文件管理工具
- STKX开发
- 通过C#自带的头文件(类)获取Windo
- C#获取电脑CPU以及内存使用率
- Syndication实现读取、创建、订阅、更新
- FMS连接FlashRemoting(附)
- tf-idf一种计算方法
- httpclient source code by csharp
- 极速北京对时(VB.NET代码)
- NServiceKit.Redis 基础操作
- XXTEA算法的C#实现和JS实现,可以互相
- Socke传输 (wince6.0系统)
- Multipart解析类库源码(HttpMultipart)
- UDP Messenger 1.0.unitypackage
- asp.net 网页静态化组件(shipingx-Stati
- SocketAsyncEventArgs完成断开编程
- 疯子ftp上传工具源码传送数据到服务
- 《C#版Ftp软件源码》
- Speex编解码调用
-
C# 播放铃声(AxWindowsMediaPla
yer)最新 - wpf实现展开收缩效果(ShrinkSpread)
- browerPhotoC#网页截图(不打开网页)
- C# 模拟时钟(自绘Graphics)
- USB扫码枪验证
- Pylon.NET Samples
- 谷歌插件直接通过C#安装
- ztree应用
- C# FileStream寫入檔案、StreamReader讀取、
- AppStore订单验证
评论
共有 条评论