|
Hey All,
I was just thinking about this question since it was/is a fairly large topic of discussion on the web this year. Isn't Blend itself a good example of the fact that it is ready ...
Just a thought ...
|
|
|
|
|
It certainly is ready for LOB apps, and if you want to take a look at the work that Karl is doing, you'll see more examples of WPF and LOB apps. BTW - Visual Studio (future versions) will be more WPF based, with more of the interface being developed in WPF.
|
|
|
|
|
Agreed.
I'm really looking forward to what Karl contributes to the whole thing. VS is a great IDE and more WPF integration can only be a good thing imho.
|
|
|
|
|
Also worth mentioning is the fact that Expression Blend is entirely written in WPF.
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
[ Blog][ Articles][ Forum Guidelines] Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
|
|
|
|
|
I'm pretty sure that was Jammer's point.
|
|
|
|
|
Yep...you're right. That's what happens when one doesn't fully read the original post.
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
[ Blog][ Articles][ Forum Guidelines] Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
|
|
|
|
|
|
WPF is LOB ready today and this space will only get way better in the future.
modified 27-Feb-21 21:01pm.
|
|
|
|
|
For sure ... i'm working on two LOB WPF apps at the moment.
|
|
|
|
|
Hi,
I am working with designing custom controls for WPF applications. My problem is I couldn't find a way to force a control property appear in the XAML window by default. It appears only when its changed by the user. for example a button has a propert called myProp which I initializes in the constructor, but It doesn't gets reflected in the XAML file of the window. pls tell me how to force a property to appear in the .xaml file, by default whenever a control is placed on the WPF window.
thanks in advance,
vinod
|
|
|
|
|
Simple answer, you can't. Sorry about that.
|
|
|
|
|
thn how microsoft manages to embed some control property into the xaml by default. Like the name proprty of a control derived from Usercontrol.
or can tell me if there is any work around
modified on Tuesday, October 14, 2008 2:50 AM
|
|
|
|
|
plz can any body give me the code which transfer to another page
like (server.Transfer()) or (response.redirect())
|
|
|
|
|
You can use System.Windows.Browser.HtmlPage.Window.Navigate( Uri ) for similar purpose in Silverlight.
Regards,
Syed Mehroz Alam
|
|
|
|
|
thank u very much
it worked with me
|
|
|
|
|
|
|
How to assign stream as source to WPF mediaelement control. In Silverlight I can do it using mediaelement.SetSource. I am not able to find out how to do it in WPF application.
|
|
|
|
|
Posting in this[^] forum would be more appropriate.
Syed Mehroz Alam.
|
|
|
|
|
|
Are you creating your own language service?
If not can you provide a few more details.
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Hi Karl,
Yes, I want to create my own language service with Syntax Highlighting and Intellisense. I want to create a usercontrol something like text box. Is this possible?
Thanks,
Charith Jayasundara
|
|
|
|
|
Charith,
I'm sorry but writing a Language Service is something I have no knowledge about.
Can I suggest posting your question on the MSDN Visual Studio forum. This will give your question the attention it needs.
If you don't get a reply there in a few days, reply to this message and I'll get you the help. If you need to reply, plesae give me the link to your question on the form.
modified 27-Feb-21 21:01pm.
|
|
|
|
|
I'm new to WPF. I'm trying to create an application that displays 3 images stacked on top of one another. The images shall be zoomable and rotateable just like in 3D. I wonder how to achieve this.
What I have done is I have created 3 mesh surfaces stacked on top of one another in 3D using Viewport3D and GeometryModel3D. It's based on a sample program I got from the internet. I haven't figured out how to paint images on the 3 surfaces.
For zooming and rotating, this code uses Transform3DGroup. It's working like a charm.
My final product will have to also have 3D markers scattered on the 3 images and when the user clicks on a marker, some tips shall be displayed. I'm not so concerned about this feature yet as it's a good to have, not must have. I need to get the foundation right first before adding this fancy feature.
Before I continue down this path, I wonder if I'm on the right track.
Any suggestions would be appreciated.
Here's my code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Media.Media3D;
namespace Wpf3DTest {
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window {
private GeometryModel3D mGeometry;
private bool mDown;
private Point mLastPos;
public MainWindow() {
InitializeComponent();
BuildSolid();
}
private void BuildSolid() {
// Define 3D mesh object
MeshGeometry3D mesh = new MeshGeometry3D();
mesh.Positions.Add(new Point3D(-1, -1, 1));
mesh.Positions.Add(new Point3D(1, -1, 1));
mesh.Positions.Add(new Point3D(-1, -1, -1));
mesh.Positions.Add(new Point3D(1, -1, -1));
mesh.Positions.Add(new Point3D(-1, 0, 1));
mesh.Positions.Add(new Point3D(1, 0, 1));
mesh.Positions.Add(new Point3D(-1, 0, -1));
mesh.Positions.Add(new Point3D(1, 0, -1));
mesh.Positions.Add(new Point3D(-1, 1, 1));
mesh.Positions.Add(new Point3D(1, 1, 1));
mesh.Positions.Add(new Point3D(-1, 1, -1));
mesh.Positions.Add(new Point3D(1, 1, -1));
//mesh.Positions.Add(new Point3D(-0.5, -0.5, 1));
//mesh.Normals.Add(new Vector3D(0, 0, 1));
//mesh.Positions.Add(new Point3D(0.5, -0.5, 1));
//mesh.Normals.Add(new Vector3D(0, 0, 1));
//mesh.Positions.Add(new Point3D(0.5, 0.5, 1));
//mesh.Normals.Add(new Vector3D(0, 0, 1));
//mesh.Positions.Add(new Point3D(-0.5, 0.5, 1));
//mesh.Normals.Add(new Vector3D(0, 0, 1));
//mesh.Positions.Add(new Point3D(-1, -1, -1));
//mesh.Normals.Add(new Vector3D(0, 0, -1));
//mesh.Positions.Add(new Point3D(1, -1, -1));
//mesh.Normals.Add(new Vector3D(0, 0, -1));
//mesh.Positions.Add(new Point3D(1, 1, -1));
//mesh.Normals.Add(new Vector3D(0, 0, -1));
//mesh.Positions.Add(new Point3D(-1, 1, -1));
//mesh.Normals.Add(new Vector3D(0, 0, -1));
//my code for the bottom face
mesh.TriangleIndices.Add(0);
mesh.TriangleIndices.Add(1);
mesh.TriangleIndices.Add(3);
mesh.TriangleIndices.Add(3);
mesh.TriangleIndices.Add(2);
mesh.TriangleIndices.Add(0);
mesh.TriangleIndices.Add(4);
mesh.TriangleIndices.Add(5);
mesh.TriangleIndices.Add(7);
mesh.TriangleIndices.Add(7);
mesh.TriangleIndices.Add(6);
mesh.TriangleIndices.Add(4);
mesh.TriangleIndices.Add(8);
mesh.TriangleIndices.Add(9);
mesh.TriangleIndices.Add(11);
mesh.TriangleIndices.Add(11);
mesh.TriangleIndices.Add(10);
mesh.TriangleIndices.Add(8);
/*
// Front face
mesh.TriangleIndices.Add(0);
mesh.TriangleIndices.Add(1);
mesh.TriangleIndices.Add(2);
mesh.TriangleIndices.Add(2);
mesh.TriangleIndices.Add(3);
mesh.TriangleIndices.Add(0);
// Back face
mesh.TriangleIndices.Add(6);
mesh.TriangleIndices.Add(5);
mesh.TriangleIndices.Add(4);
mesh.TriangleIndices.Add(4);
mesh.TriangleIndices.Add(7);
mesh.TriangleIndices.Add(6);
// Right face
mesh.TriangleIndices.Add(1);
mesh.TriangleIndices.Add(5);
mesh.TriangleIndices.Add(2);
mesh.TriangleIndices.Add(5);
mesh.TriangleIndices.Add(6);
mesh.TriangleIndices.Add(2);
// Top face
mesh.TriangleIndices.Add(2);
mesh.TriangleIndices.Add(6);
mesh.TriangleIndices.Add(3);
mesh.TriangleIndices.Add(3);
mesh.TriangleIndices.Add(6);
mesh.TriangleIndices.Add(7);
// Bottom face
mesh.TriangleIndices.Add(5);
mesh.TriangleIndices.Add(1);
mesh.TriangleIndices.Add(0);
mesh.TriangleIndices.Add(0);
mesh.TriangleIndices.Add(4);
mesh.TriangleIndices.Add(5);
// Right face
mesh.TriangleIndices.Add(4);
mesh.TriangleIndices.Add(0);
mesh.TriangleIndices.Add(3);
mesh.TriangleIndices.Add(3);
mesh.TriangleIndices.Add(7);
mesh.TriangleIndices.Add(4);
*/
// Geometry creation
mGeometry = new GeometryModel3D(mesh, new DiffuseMaterial(Brushes.YellowGreen));
mGeometry.Transform = new Transform3DGroup();
group.Children.Add(mGeometry);
}
private void Grid_MouseWheel(object sender, MouseWheelEventArgs e) {
camera.Position = new Point3D(camera.Position.X, camera.Position.Y, camera.Position.Z - e.Delta / 250D);
}
private void Button_Click(object sender, RoutedEventArgs e) {
camera.Position = new Point3D(camera.Position.X, camera.Position.Y, 5);
mGeometry.Transform = new Transform3DGroup();
}
private void Grid_MouseMove(object sender, MouseEventArgs e) {
if(mDown) {
Point pos = Mouse.GetPosition(viewport);
Point actualPos = new Point(pos.X - viewport.ActualWidth / 2, viewport.ActualHeight / 2 - pos.Y);
double dx = actualPos.X - mLastPos.X, dy = actualPos.Y - mLastPos.Y;
double mouseAngle = 0;
if(dx != 0 && dy != 0) {
mouseAngle = Math.Asin(Math.Abs(dy) / Math.Sqrt(Math.Pow(dx, 2) + Math.Pow(dy, 2)));
if(dx < 0 && dy > 0) mouseAngle += Math.PI / 2;
else if(dx < 0 && dy < 0) mouseAngle += Math.PI;
else if(dx > 0 && dy < 0) mouseAngle += Math.PI * 1.5;
}
else if(dx == 0 && dy != 0) mouseAngle = Math.Sign(dy) > 0 ? Math.PI / 2 : Math.PI * 1.5;
else if(dx != 0 && dy == 0) mouseAngle = Math.Sign(dx) > 0 ? 0 : Math.PI;
double axisAngle = mouseAngle + Math.PI / 2;
Vector3D axis = new Vector3D(Math.Cos(axisAngle) * 4, Math.Sin(axisAngle) * 4, 0);
double rotation = 0.01 * Math.Sqrt(Math.Pow(dx, 2) + Math.Pow(dy, 2));
Transform3DGroup group = mGeometry.Transform as Transform3DGroup;
QuaternionRotation3D r = new QuaternionRotation3D(new Quaternion(axis, rotation * 180 / Math.PI));
group.Children.Add(new RotateTransform3D(r));
mLastPos = actualPos;
}
}
private void Grid_MouseDown(object sender, MouseButtonEventArgs e) {
if(e.LeftButton != MouseButtonState.Pressed) return;
mDown = true;
Point pos = Mouse.GetPosition(viewport);
mLastPos = new Point(pos.X - viewport.ActualWidth / 2, viewport.ActualHeight / 2 - pos.Y);
}
private void Grid_MouseUp(object sender, MouseButtonEventArgs e) {
mDown = false;
}
}
}
|
|
|
|
|
|