|
Ok, I think I may have solved this, but if what I put below isn't the real solution, please let me know.
Where I was setting:
<ctl:ComboBoxControl ItemsSource="{Binding Path=Users, Mode=TwoWay}"/>
I hadn't set the datacontext of the control the combobox was being hosted in. i.e. DataContext = this;
|
|
|
|
|
If you haven't set a DataContext , then your binding would fail here so it would seem fair to say that you found your issue.
|
|
|
|
|
Thanks for confirming Pete.
|
|
|
|
|
Hi all , i'm working on wpf application currently, i doing face detection using microsoft kinect for that i want an ANIMATION during face scanning period.
it should be like one line keep animation on the face square just like xerox machin's laser lightfrom top to bottem.
Thanks in advance..
|
|
|
|
|
Hi!
What is the namespace to include for ShellExecute to compile?
I've to open a URL from WPF Emulator. How to do this? I tried <pre lang="c++">Process.Start()</pre>
But it opens many times. ShellExecute() doesn't compile.
It gives the following error:
The name 'ShellExecute' does not exist in the current context
How to open a URL in WPF?
|
|
|
|
|
I just use Process.Start to open a URL. Here's an example from the code I'm looking at right now:
public static void OpenUrl(string url)
{
if (string.IsNullOrWhitespace(url))
throw new ArgumentNullException("url");
Process.Start(url);
}
|
|
|
|
|
Pete O'Hanlon wrote:
Process.Start(url);
I've used this. It's opening the URL many times. I want only one time. How to do this? What about ShellExecute with WPF?
|
|
|
|
|
It only opens it once per execution - sounds like you're hooked into calling that many times - and you would have to write interop code for ShellExecute , where you'd still get the same issue. Put a breakpoint on your Process.Start code and see how many times it's being called.
|
|
|
|
|
Hi!
I've to change the state of the application to minimized before opening the URL.
I'm using this code.
<pre lang="c#">
#if WINDOWS
this.WindowState = WindowState.Minimized;
#endif
</pre>
But it shows the following error:
The name 'WindowState' does not exist in the current context
How to minimze the application before opening the URL?
|
|
|
|
|
You may need to use the FormWindowState enumeration as described here[^].
Programming is work, it isn't finger painting. Luc Pattyn
|
|
|
|
|
I don't think that's the problem - this error would indicate he's trying to use the minimize function from a piece of none-window code.
|
|
|
|
|
I Agree; it's actually not clear which of the references is out of context.
Programming is work, it isn't finger painting. Luc Pattyn
|
|
|
|
|
I assume you're not trying this from the main window (or from the code of any window in your application) then. To minimize the main window from another location, try:
App.Current.MainWindow.WindowState = System.Windows.WindowState.Minimized
|
|
|
|
|
Hi,
In VS 2010, when i try to publish i am getting all the files including .cs pages, which contain c# codes, project file etc. I need only the required files for publish.
When i build using Release mode, it does not create all files.
How can i publish as like done in VS2009.
Thankyou,
YP
|
|
|
|
|
Right click on 'MyProject.Web' project and click publish. There select
Publish method- File System
Target Location - Path
Select delete all existing files prior to publish.
Now click publish. It will create .xap file for your silverlight project.
Manoj Kumar
|
|
|
|
|
hi guy's
i have code in c# windows form i want to view it form in emulator in WP7 when run this program .... i ask it allow and how to view form in c# view it in another program (emulator wp7 ) plz?
|
|
|
|
|
You can't view a Windows Form in the WP7 emulator. The emulator is targetted specifically at the Silverlight runtime that Windows Phone uses, which uses a very specialist version of the .NET runtime.
|
|
|
|
|
okey thnx
|
|
|
|
|
Hi,
i have 2 tabitem, each one cotain a wpf gdatagrid
i want to pass data from grid1 in tabitem1 to grid2 in tabintem2
when i click on tab item2 or on boutton.
i tried this code but i get exception:
L'élément possède déjà un parent logique. Il doit être détaché de l'ancien parent avant d'être attaché au nouveau.
private void btnValidate_Click(object sender, RoutedEventArgs e)
{
for (int j = 0; j < i - 1; j++)
{
TextBlock x = dgrecep.Columns[0].GetCellContent(dgrecep.Items[j]) as TextBlock;
if (x != null)
{
if (v.validate(x.Text))
{
dgrecep2.Items.Add(dgrecep.Columns[0].GetCellContent(dgrecep.Items[j]));
}
else
{
MessageBox.Show("non valide");
}
|
|
|
|
|
Why on earth are you doing this via code behind? You really need to read up on MVVM, and judging by the number of questions you have posted in this forum, I would suggest that you need to read a basic book on WPF, such as Adam Nathan's excellent WPF Unleashed.
|
|
|
|
|
I am a student and I'm doing my final year project and this project is the first work with WPF, I downloaded a book and I make every effort to learn because I believe in that "le difficile c'est le chemin" and I asked a lot of questions because I have a month to develop my application also it is not MVVM because company demanded another architecture...thank you
|
|
|
|
|
I find it hard to believe that a company would demand no architecture whatsoever. What you are doing is code behind and is not suited to solving the problem you are trying to solve. Now is the time for you to embrace the right way to do it.
|
|
|
|
|
hello Everyone
Can someone please tell me, what is the database SQL query to display the name of the table only in to datagrid...
kind regards
roni
|
|
|
|
|
Presumably you are using sql server - look into the sys.sysobject and the system views, all the information is in there. The system views were set up in 2005 (I think) specifically for this.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi Mycroft Holmes
Actually I'm using Microsoft access 2007 database, I'm not using the SQL Server, maybe you can have a look at the code below and tell me what am I doing wrong...
private void Window_Loaded(object sender, RoutedEventArgs e)
{
string ConString = ConfigurationManager.ConnectionStrings["ConString"].ConnectionString;
string CmdString = string.Empty;
using (OleDbConnection myConnection = new OleDbConnection(ConString))
{
CmdString = "SELECT FoodMenu FROM MSysObjects WHERE (FoodMenu Not Like 'MSys*') AND (Type In (1,4,6)) ORDER BY FoodMenu";
OleDbCommand comm = new OleDbCommand(CmdString, myConnection);
OleDbDataAdapter sda = new OleDbDataAdapter(comm);
myConnection.Open();
DataTable dt = myConnection.GetSchema("Tables");
foreach (DataRow dataRow in dt.Rows)
{
DataGridMenuTables.Items.Add(dataRow["FoodMenu"].ToString().Trim());
}
}
}
Basically what I'm trying to do is to display the database table name in to datagrid, but i can't figur out the SQL query how to do it, maybe you can help me and solve it...
kind regards
Roni
|
|
|
|