我又藉由一些文章 找到另一家3rd party的WPF controls
而且好像這家也十分有名 叫Infragistic
我也找到他們有做Ribbon的Solution
有興趣參考以下link吧..
http://www.infragistics.com/hot/wpf-beta.aspx#xamRibbon
Powered by ScribeFire.
Powered by ScribeFire.
Powered by ScribeFire.
Powered by ScribeFire.
Powered by ScribeFire.
Powered by ScribeFire.
Last night I presented Code Generation, Software Factories and Visual Studio Extensibility at Direct Supply. Below is the project download with all of the source followed by many useful links related to the various topics.
[ Download the sample project: SmallSharpTools.VisualStudioPlugins.zip ]
If you have any other links that you feel are useful, please add them below in the comments.
Powered by ScribeFire.
Powered by ScribeFire.
Powered by ScribeFire.
This is a live webcam brought into WPF using my MediaBridge hack. I swear I don't look that greasy IRL.
Powered by ScribeFire.
Powered by ScribeFire.
void MakeButton()
{
Button b2 = new Button();
b2.AddHandler(Button.ClickEvent, new RoutedEventHandler(Onb2Click));
}
void Onb2Click(object sender, RoutedEventArgs e)
{
//logic to handle the Click event
}
The next example shows the C# operator syntax
(Microsoft Visual Basic .NET has slightly different operator syntax
because of its handling of indirection):
C# Method2-------------------------------------------------
void MakeButton2()
{
Button b2 = new Button();
b2.Click += new RoutedEventHandler(Onb2Click2);
}
void Onb2Click2(object sender, RoutedEventArgs e)
{
//logic to handle the Click event
}
Powered by ScribeFire.
Powered by ScribeFire.
Powered by ScribeFire.
using System;在下列程式碼中,示範了如何使用 PtrToStructure 方法,將記憶體的 Unmanaged 區塊封送處理成 Managed 結構。
using System.Runtime.InteropServices;
public struct Point
{
public int x;
public int y;
}
class Example
{
static void Main()
{
// Create a point struct.
Point p;
p.x = 1;
p.y = 1;
Console.WriteLine("The value of first point is " + p.x + " and " + p.y + ".");
// Initialize unmanged memory to hold the struct.
IntPtr pnt = Marshal.AllocHGlobal(Marshal.SizeOf(p));
try
{
// Copy the struct to unmanaged memory.
Marshal.StructureToPtr(p, pnt, false);
// Create another point.
Point anotherP;
// Set this Point to the value of the
// Point in unmanaged memory.
anotherP = (Point)Marshal.PtrToStructure(pnt, typeof(Point));
Console.WriteLine("The value of new point is " + anotherP.x + " and " + anotherP.y + ".");
}
finally
{
// Free the unmanaged memory.
Marshal.FreeHGlobal(pnt);
}
}
}
Powered by ScribeFire.
這幾天一直在try Windows Vista的Gagdget.... 中秋連假還一直在加班 :-(
最後有一個major bugs就是卡在這裡~~ 超麻煩的 不過還好給我找到了....
呵~
Powered by ScribeFire.
之前在合作一個case 好像我就有使用過這樣的技法~~ 不過這個link比較簡單...:p
Powered by ScribeFire.
Powered by ScribeFire.
Powered by ScribeFire.
Powered by ScribeFire.
powered by performancing firefox
Powered by ScribeFire.
Powered by ScribeFire.
--> DataBinding 到enum valuem, Copy & Paste如下
Some of the FAQs about data binding are:
• How do I bind to a method?
• How do I bind between instantiated controls?
• How do I bind an ItemsControl to an enum?
I put together a quick sample that should answer the above questions:
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
SizeToContent="WidthAndHeight"
Title="Show Enums in a ListBox using Binding">
<Window.Resources>
<ObjectDataProvider MethodName="GetValues"
ObjectType="{x:Type sys:Enum}"
x:Key="AlignmentValues">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="HorizontalAlignment" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
</Window.Resources>
<Border Margin="10" BorderBrush="Aqua"
BorderThickness="3" Padding="8">
<StackPanel Width="300">
<TextBlock>Choose the HorizontalAlignment
value of the Button:</TextBlock>
<ListBox Name="myComboBox" SelectedIndex="0" Margin="8"
ItemsSource="{Binding Source={StaticResource
AlignmentValues}}"/>
<Button Content="Click Me!"
HorizontalAlignment="{Binding ElementName=myComboBox,
Path=SelectedItem}"/>
</StackPanel>
</Border>
</Window>
I am curious what online resources people have found to be excellent. The ones I frequent are listed below and contain video lectures: 1. Stanford collection of Knuth videos 2. University of Texas collection of Dijkstra videos 3. Vega Video Collection of Feynman Lectures 4. MIT's Open CourseWare - Numerous video lectures are featured here, including full courses in Linear Algebra, Mathematics for Engineering, Differential Equations, and Physics 1, 2, and 3. The Physics lectures are by Walter Lewin who is amazing. 5. Webcast Archive of Berkeley Courses 6. SICP Video Lectures by Abelson and Sussman 7. QMUL Mirror of the ArsDigita courses 8. Clay Math Video Collection - Numerous videos including Timothy Gowers speaking on the importance of mathematics, and Wiles and Witten talking to the 2001 IMO competitors. 9. Archive.org Collection of ArsDigita Colloquia - Includes terrific lectures by Sipser on the history of NP vs P, and Sussman on the legacy of Computer Science. Also includes videos by Richard Stallman.
using System.Threading
using System.Runtime.InteropServices;
public class Form1 : Form
{
[STAThread]
static void Main()
{
bool createdNew;
Mutex m = new Mutex(true, "YourAppName", out createdNew);
if (! createdNew)
{
// app is already running...
MessageBox.Show("Only one instance of this application is allowed at a time.");
return;
}
Application.Run(new Form1());
// keep the mutex reference alive until the normal termination of the program
GC.KeepAlive(m);
}
}
另外 要foreground exising one的話 code below
f your application can run with Full Trust permissions, we can take
this a step further and find the window of the application instnace
already running and bring it to the front for the user:
public class Form1 : Form
{
[STAThread]
static void Main()
{
bool createdNew;
System.Threading.Mutex m = new System.Threading.Mutex(true, "YourAppName", out createdNew);
if (! createdNew)
{
// see if we can find the other app and Bring it to front
IntPtr hWnd = FindWindow("WindowsForms10.Window.8.app3", "YourAppName");
if(hWnd != IntPtr.Zero)
{
Form1.WINDOWPLACEMENT placement = new Form1.WINDOWPLACEMENT();
placement.length = Marshal.SizeOf(placement);
GetWindowPlacement(hWnd, ref placement);
if(placement.showCmd != SW_NORMAL)
{
placement.showCmd = SW_RESTORE;
SetWindowPlacement(hWnd, ref placement);
SetForegroundWindow(hWnd);
}
}
return;
}
Powered by ScribeFire.
One of the keys to understanding the role of the Visual object is to understand the difference between immediate mode and retained mode
graphics systems. A standard Win32 application based on GDI or GDI+
uses an immediate mode graphics system. This means that the application
is responsible for repainting the portion of the client area that is
invalidated, due to an action such as a window being resized, or an
object changing its visual appearance.
In contrast, WPF uses a retained mode system. This means application
objects that have a visual appearance define a set of serialized
drawing data. Once the drawing data is defined, the system is
responsible thereafter for responding to all repaint requests for
rendering the application objects. Even at run time, you can modify or
create application objects, and still rely on the system for responding
to paint requests. The power in a retained mode graphics system is that
drawing information is always persisted in a serialized state by the
application, but rendering responsibility left to the system.
One
of the biggest benefits in using retained mode graphics is that WPF can
efficiently optimize what needs to be redrawn in the application. Even
if you have a complex scene with varying levels of opacity, you
generally do not need to write special-purpose code to optimize
redrawing. Compare this with Win32 programming in which you can spend a
great deal of effort in optimizing your application by minimizing the
amount of redrawing in the update region. See Redrawing in the Update Region for an example of the type of complexity involved in optimizing redrawing in Win32 applications.
powered by performancing firefox
powered by performancing firefox
AddType application/manifest .manifest
AddType application/xaml+xml .xaml
AddType application/x-ms-application .application
AddType application/x-ms-xbap .xbap
AddType application/octet-stream .deploy
好啦~~ 我測試過在IE上WinForm跟WPF還有XBAP都可以正確無誤的使用了
但是如果我想要用FireFox呢? 現在來說 Firefox不支援ClickOnce跟XBAP
不過都有替代的解決方案.....
在Firefox裡灌一個叫FFClickOnce的Plug-in 就可以使用ClickOnce的技術
另外XBAP還是沒辦法使用 目前看來只有一種作法
就是灌IE TAB in FireFox,即這個Tab其實是Internet Explorer的一個視窗
嵌在firefox的Tab裡
然後在Firefox的Menu\擴充套件\裡的IE Tab選項 加入/\.xbap$/
表示未來如果看到*.xbap的網址 一律用IE來開啟
好啦~~~ 這大概是一下午研究的心得 @@ 也花也不少時間
powered by performancing firefox
powered by performancing firefox