|
If I could see the markup, it will be easier to get an idea.
|
|
|
|
|
Here is the XAML
<listbox x:name="lstScreens" xmlns:x="#unknown"> IsSynchronizedWithCurrentItem="True"
Grid.Row="1"
ItemsSource="{Binding Path=ReportScreens}"
ItemTemplate="{DynamicResource ScreenTabScreen}"
Margin="10,0,10,10">
And I can email any/all of the code for these areas if you would like.
|
|
|
|
|
Sure - my email is pete dot ohanlon at gmail dot com.
|
|
|
|
|
Hi - I'm still waiting for the code. If you want to zip your project up, I'll take a look at it later on. My email is in my earlier post.
|
|
|
|
|
Sorry, Pete I did send you the code on Wednesday I used pete.ohanlon@gmail.com. I resent the code again just now, it will come from zoey.babongita@gmail.com.
If you don't get it soon, please let me know, You should have two emails now, the first one being a few classes, and the second one being the entire solution. Pick your poison.
Thanks
|
|
|
|
|
I've got them now. It looks like the original mail was picked up by the spam filter (though I'm not sure why). I'll take a look at them when I get home tonight.
|
|
|
|
|
Hi there, I've been working with Bea's solution here for a while and finding it very helpful. Problem now I'm having is when I drag-n-drop items within or to another ListView control and I want to scroll up/down "during" the drag (moving an item from index 30 to index 1), it's not happening. I would have to drag to the top of the visual items in the ListView, manually scroll up, then drag again, eventually ending at the position I want. This isn't very user friendly.
Now I found the function (DragDropHelper.DropTarget_PreviewDragOver) that I would want to do the testing of which item is being dragged over, and I'm getting that.
<br />
Dim pt As Point = e.GetPosition(DirectCast(Me.targetItemsControl, UIElement))<br />
<br />
' Perform the hit test against a given portion of the visual object tree.<br />
Dim result As HitTestResult = VisualTreeHelper.HitTest(Me.targetItemsControl, pt)<br />
Now from there I can get the DependencyProperty of this visual hit
<br />
Dim lvi As ListViewItem = TryCast(GetDependencyObjectFromVisualTree(TryCast(result.VisualHit, DependencyObject), GetType(ListViewItem)), ListViewItem)<br />
Which is of a ListViewItem. Now in the function DropTarget_PreviewDragOver I have the "DraggedItem" which is of type Picture in Bea's example, but that can change depending on the ObservableCollection you have bound to the ListView. Now, I want to drag the ListView up or down depending on where the mouse is on the control. I've attempted with the below un-finished non-working code
<br />
If lvi IsNot Nothing Then<br />
If pt.Y <= 25 Then<br />
Dim lv As ListView = TryCast(targetItemsControl, ListView)<br />
If lv IsNot Nothing Then<br />
Dim index As Integer = lv.Items.IndexOf(lvi)<br />
If index > 1 Then<br />
lv.ScrollIntoView(lv.Items(index - 1))<br />
End If<br />
End If<br />
Else<br />
If pt.Y >= Me.targetItemsControl.ActualHeight - 25 Then<br />
Debug.Print("Scroll Down")<br />
End If<br />
End If<br />
End If<br />
Can someone point me in the right direction to get this ItemsControl or ListView to scroll when dragging over the items??
Thanks!
|
|
|
|
|
hi everybody!
I have a problem that I can't find a solution.
I made a project (vs2008 xp sp2) wpf browser aplication.
I need to use midi functions of winmm.dll but there is a problem with "System.Security.Permissions.SecurityPermission".
I made a simple project (code below) with a button where by pressing it the debug stops.
.....
using System.Runtime.InteropServices;
namespace WpfBrowserApplication1
{
public partial class Page1 : Page
{
[DllImport("winmm.dll")] public static extern int midiInGetNumDevs();
public Page1()
{
InitializeComponent();
}
private void button1_Click(object sender, RoutedEventArgs e)
{
int aa = midiInGetNumDevs();
}
}
}
What shall I do? Somebody can help me?
My final project is to realize a musical keyboard that should play music according to a partiture upon the web. (sorry for my english)
Many Thanks for your attention.
|
|
|
|
|
Calling into native code probably isn't something that you can do in a WPF browser app since they normally run in a partial trust environment: WPF Partial Trust Security[^].
As far as your goal of a musical keyboard deployed to the web is concerned:
* look into the possibility of using Silverlight (Silverlight Audio and Video Overview[^]
* you could go with a regular WPF application and distribute it using ClickOnce (see what MediaElement can do for you here)
|
|
|
|
|
Hi ,
i'm trying to understand how create role and save them in the database so doing i can add or delete the role for each user when i need ...i explain better my idea.
I created a form authentication(username,password) in Wpf to access to the application now i wish create roles and save on the database(with Linq ToSql) so doing i will assign roles(to deny or access to use buttons,Forms,Delete,Add,Edit etc.etc.) to user's for use the application but i don't know how procede with code to create roles and save it on database.
Do you have any idea to clarify my purpose and procede to work out this feature?
Have a happy day.
Bye
|
|
|
|
|
Sorry ,
maybe my question is not clear i fell confuse about that....
If you have some link that can clarify my mind i'm happy for your support.
Have a nice day.
Bye
|
|
|
|
|
In order to make this message go away on WCF method invoke,
"cannot be ISerializable and have DataContractAttribute attribute"
I commented out "Serializable" and ISerializable
<br />
[DataContract()]<br />
[GenericObjectAttribute(ObjectClassifier = "Person")]<br />
public class Person : IPerson
{<br />
...<br />
}
Does this means all DataContract must NOT be ISerilizable?
Thanks!
dev
|
|
|
|
|
If you turn your DataContract into a NetDataContractSerializer, you can mark it as Serializable. However, the DataContract is serialized for you by WCF so you shouldn't need to manage this yourself.
|
|
|
|
|
|
No problem.
|
|
|
|
|
Hi all,
I'm very new to WPF and so don't mind me asking very silly questions.
Well I'm creating this application where I have a window which hosts a "login" and a "loginCheck" usercontrol. Both usercontrols are not visible at the same time and have the same background but different foregrounds elements. When the user clicks the sign in button in the Login usercontrol I want the Login usercontrol to make a flip and show the loginCheck usercontrol where the authentication will happen and feedback the user about successful or unsuccessful login status and then if its unsuccessful then again flip to the login side, but if its successful I want it to fade away and get removed from the parent container(as in children.remove(login)).
Now my problem is I have created both login and logincheck usercontrols but how can I make the login to logincheck 3D flip happen after the user presses the "Sign In" button from the login usercontrol and also remove it after successful authentication.
Any help would be deeply appreciated.
Regards,
Soham Dasgupta
|
|
|
|
|
Hi,
My problem is when i am trying to use the header value of existing treeviewitems.
Let me explain the situation.
1)I have a label .I want to give content to that lable.
2) I have treeview control with 1 parent and 3 childs.I am using context menu .
I am using this context menu for the above tree control. i have one menu item in the context menu.
3)So whenever i do mouserightclick on any node of treecontrol(without selecting node--simply mouserightclick on nodes) it will display menuitem of context menu.(selecting node also ok.but currently i am trying without selecting the node)
4)if i click the menuitem it will fire an event , in which i am assigning content to label
5) I want to assign the currentnode header value to label content
I am trying it through code.of course i don't know how it will be done in xaml also.
Still i am thinging whether it is possible or not?
If possible could anyone provide source code to overcome this probelm as soon as possible
Thanks in Advance
Rama Krishna Makkena
|
|
|
|
|
From what I could understand, in the context menu items click event you want to set a controls property ??
If yes, I found this on msdn [^]
Karl Shifflet has given the following suggestion, "Have you tried databinding a specific value to the menuitem? You can stick a value in the Tag property, or you can add a property to the MenuItem in a derived class."
You might need to handle OnContextMenuOpening Example[^]
|
|
|
|
|
Hello everyone,
I have canvas that contains several controls representing network nodes. There are several types of nodes. After selecting one node I need to display property page for it. Each node type has its own customize property page. For example there are nodes that can be accessed via RS232 or TCP/IP or WLAN. Property page should allow to change connection setting and display statistical info about selected connection.
I would like know whats the WPF way of doing such a thing, what would be the 'cleanest' solution?
|
|
|
|
|
A really neat way of dealing with this would be to create your property page in the Adorner layer. You can do some amazing things with this type of effect.
|
|
|
|
|
Hi again!
I need your help again, this time to paint an Oszillograph.
That's what I have so far:
void DrawSpectrum(float[] TraceData, int LeftBwPoint, int RightBwPoint)
{
System.Windows.Point[] PointsCurve = new System.Windows.Point[TraceData.Length];
float maxValue = -5000;
float minValue = 5000;
int curveCount = 0;
for (int i = 0; i < TraceData.Length; i++)
{
if (TraceData[i] > maxValue)
{
maxValue = TraceData[i];
}
if (TraceData[i] < minValue)
{
minValue = TraceData[i];
}
PointsCurve[i].X = i;
PointsCurve[i].Y = (int)TraceData[i];
}
PointCollection pointcoll = new PointCollection();
for (int i = 0; i < TraceData.Length; i = i + TraceData.Length / 20)
{
pointcoll.Add(PointsCurve[i]);
}
DrawPictureSpectrum(pointcoll);
}
Values I get are for example:
{0;-54 25;-53 50;-50 75;-50 100;-49 125;-48 150;-48 175;-48 200;-48 225;-48 250;-48 275;-48 300;-48 325;-48 350;-48 375;-48 400;-49 425;-49 450;-50 475;-52 500;-54}
That's ok, but how can I paint / present this? (minus values!)
I did this once for Windows Forms by creating a Bitmap, painting on it and passing it to a picturebox - unfortunately it seems these techniques won't work in wpf.
Help would be really apreciated, I close to throw out my notebook out of the window
no serious, please help me with this.
|
|
|
|
|
If you have the option to use the latest .NET 3.5, then check out WriteableBitmap[^] for an efficient way to plot points. This doc has an example inline.
|
|
|
|
|
Thanks for the tip, but I'm not sure if this is really "efficient". Especially the unsafe part is a bit weird for something as full managed as wpf.
What would be a better idea, or better - what would be a typical wpf approach to present data like this (and keep in mind it's being updated a few times every second).
Should I draw directly on a control (and if so how to deal with the negative values)?
If I should draw on a control, how can I do it and how can I get rid of the outdated data without producing memory leaks?
I know I'm asking for much, but I'm really stuck with this.
Nethertheless, thank you very much gurge60 for your help
|
|
|
|
|
Any direct writing to memory like that will be unsafe, but it's
also very efficient.
If you can't use unsafe code then you will sacrifice efficiency.
For example, you could use Marshal.Copy() to copy bits into and out of a
WriteableBitmap's backbuffer, but it will be less efficient.
You could also wrap a WriteableBitmap's backbuffer in a System.Drawing.Bitmap
(GDI+) and use System.Drawing.Graphics methods to draw on the bitmap, which
could even be less efficient.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
I am trying to create a WPF application using MVP pattern. The user of the application should be able to create customers and edit customer information. The data is stored in the SQL database at the backend.
Can any one help me by providing information regarding MVP pattern and how we can implement the same with WPF application.
Thanks in advance.
Best regards,
Sarvani
|
|
|
|