|
I don't do PRISM but I still think you want to get rid of the x:key. Also the / in front of AQUA doesn't look right either. Try removing that as well.
"You get that on the big jobs."
|
|
|
|
|
I was thinking about creating a WPF app. The main window would have a background like this[^].
Any reason not to use an image of some kind, or is it better to try to do the graphic in XAML?
Thanks
Everything makes sense in someone's mind
|
|
|
|
|
Hi there I want a great HTML editor in WPF. So for this what I did is that I added a WebBrowser to WPF window and navigated it to the html page with the TinyMCE html editor in it. However when I rin the app, the browser control shows the script warning as follows:
http://s13.postimage.org/rod6itsjb/brerr.png[^]
XAML
<Window x:Class="TinyMceWpf.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525" >
<Grid>
<WebBrowser Name="webBrowser1" Margin="0,0,0,54" />
<Button Content="Get Html" Height="31" HorizontalAlignment="Left" Margin="22,0,0,17" Name="btnGetHtml" VerticalAlignment="Bottom" Width="108" Click="btnGetHtml_Click" />
</Grid>
</Window>
XAML.CS
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;
namespace TinyMceWpf
{
///
/// Interaction logic for MainWindow.xaml
///
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
webBrowser1.Navigate(new Uri(@"C:\Users\MAHESH\Desktop\TechNode\WPF\MytTechDos\TinyMceWpf\TinyMceWpf\TinyMceWpf\edit.html"));
}
private void btnGetHtml_Click(object sender, RoutedEventArgs e)
{
string editHtml = this.webBrowser1.InvokeScript("getContent").ToString();
MessageBox.Show(editHtml);
}
}
}
So here how can I suppress the script error message of the web-browser control?
I found many solutions online some that uses SupressScriptErrors property which I did not find in WOF WebBrowser control and the others that used Reflection. I tried many of them.
I tried Wolfie5's Relflection solution at http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/4f686de1-8884-4a8d-8ec5-ae4eff8ce6db/[^]. But did not worked for me.
Also I tried another Reflection solution that I explained in greated details here:
http://stackoverflow.com/questions/10030300/script-warning-in-wpf-webbrowser#comment12832540_10030300[^]
I did not get any help on these forums. SO Code Project is my last resort.
Please help. I am stuck here. Thank you.
|
|
|
|
|
I have a asp application that calls a web service sessionservice.asmx. When it tries to make the service call I get the error: error: the remote server returned the error: NotFound. I believe the problem is the wrong endpoint address in the serverreference.clientconfig file. What is the proper endpoint to use when running from the debugger?
|
|
|
|
|
|
I just created a new WPF app. I set up some folder, then added a resource dictionary called AppResources in the Resources folder.
In my window, all I have is
<Window x:Class="MyApp.Views.Window2"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window2"
Height="400"
Width="400">
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Resources\AppResources.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>
<Grid>
</Grid>
</Window>
The compiler is complaining with
"The file 'Resources\AppResources.xaml' is not part of the project or its 'Build Action' property is not set to 'Resource'."
The file IS part of the project and its Action property IS set to Resource.
I'v been in this project for all of 5 minutes and I can't even get past this.
Anyone know WTF is wrong here??????
Everything makes sense in someone's mind
|
|
|
|
|
That did it.
Thank you
Everything makes sense in someone's mind
|
|
|
|
|
Kevin, you (and the rest of us) are benefiting from some excellent support here, while thanks are appreciated it would be better to upvote the useful answers!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
You are right. I will do so from now on.
Everything makes sense in someone's mind
|
|
|
|
|
after adding items to list, still it show "-1" as their index
|
|
|
|
|
Nope. No idea. No code. Throw us a rope here mate; actually give us some code to look at.
|
|
|
|
|
http://www.microsoft.com/design/toolbox[^]
Its very useful site i guess for silverlight startup.I want similar website which could elaborate WPF developments..
I wanna develop some application in wpf..But i am getting confused in many things..
If i could get a simple elaboration by videos then it will be great..
|
|
|
|
|
The basic concepts are the same, do the Silverlight training, this will supply the conceptual framework and allow you to step into WPF.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I have binded two simple text strings into a ListBox. works fine. But, I'm having trouble binding a text string and a checkbox to a listbox. The text shows up, but not the checkboxes. I did the code almost the same. It compiles fine. Can anyone tell me why?
List<ExternalAlarmEntry> eaentry = new List<ExternalAlarmEntry>();
CheckBox[] eaCB = new CheckBox[64];
void CreateExternalAlarmTable()
{
ExternalAlarmTable.Height = 120;
for (byte i = 0; i < 5; i++)
{
eaCB[i] = new CheckBox();
eaCB[i].IsChecked = false;
eaentry.Add(new ExternalAlarmEntry()
{
ZoneNum = "Zone " + (i + 1),
ExternalAlarm = eaCB[i]
});
}
ExternalAlarmTable.ItemsSource = eaentry;
}
public class ExternalAlarmEntry
{
public string ZoneNum { get; set; }
public CheckBox ExternalAlarm;
}
|
|
|
|
|
You don't bind UI elements like this. Change the ExternalAlarm property into a boolean (and make it a property, not a field), then use this in your list box ItemTemplate. The ItemTemplate would look something like this:
<DataTemplate x:Key="myItemsTemplate">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="30" />
<ColumnDefinition />
<Grid.ColumnDefinitions>
<CheckBox IsChecked="{Binding ExternalAlarm}" Grid.Column="0" />
<TextBlock Text="{Binding ZoneNum}" Grid.Column="1" />
</Grid>
</DataTemplate> Your list box will look like this
<ListBox ItemTemplate="{StaticResource myItemsTemplate}" x:Name="ExternalAlarmTable" />
|
|
|
|
|
Obviously, I'm not getting it. I've been in the embedded world for 25 years. And, some of the Windows programming isn't making sense quite yet. I guess I'll have to get the exact code working before I can analyze each piece before I understand how it works.
I already have a Grid broken down into subgrids. One of the subgrids, I would like to contain this ListBox. How do I incorporate your WPF code into my subgrid? Here is the previous WPF code in which you said my method isn't going to work.
Also, in my C# code, I will populate the ListBox based on the system the user selects. If he selects system 'A', the box will have 5 entries. If he selects system 'B', the box will have 64 entries. That was the previous code I sent you. I can't do it all in WPF.
<DataGrid Grid.Column="0" Grid.Row="1" Height="150" Width="300"
CanUserAddRows="false"
AutoGenerateColumns ="false"
HorizontalAlignment="Left"
RowHeight ="20"
Margin="15,10,0,0"
VerticalAlignment="Top"
Name="ExternalAlarmTable"
CanUserSortColumns="False"
CanUserResizeColumns="False"
CanUserReorderColumns="False"
CanUserResizeRows="False"
SelectionUnit="Cell">
<DataGrid.Columns>
<DataGridTextColumn Header = "Zone #"
Width = "SizeToHeader"
Binding = "{Binding ZoneNum}"
IsReadOnly="true"/>
<DataGridTextColumn Header = "External Alarm Setting"
Binding = "{Binding ExternalAlarm}"
Width="*"/>
</DataGrid.Columns>
</DataGrid>
|
|
|
|
|
OK. I see what you're doing. Right, the problem here is that you are attempting to add a checkbox to a DataGridTextColumn . As I said in my post above, convert ExternalAlarm into a boolean property, and change the DataGridTextColumn into a DataGridCheckBoxColumn .
If you need to implement change notification, so that your display is updated automatically if the ExternalAlarm changes, you'll need to make sure your class implements INotifyPropertyChanged and raise the PropertyChanged event when the value changes in ExternalAlarm .
|
|
|
|
|
Excellent. That's moderately working.
1. How do I position the CheckBoxes at a certain location in the column (like all the way to the left as opposed to in the middle of the column)?
2. If I do the same kind of binding construct for another List of TextMessages and have a class with strings Zone and Text Messages. How do I bind the TextBox to the List? I had that working somewhat and bound the Text Message as a simple string (DataGridTextColumn), but there was no way to restrict the size to 160 characters - like there is with a TextBox. There should be a class DataGridTextBoxColumn, but there is not.
|
|
|
|
|
1. You should be able to set HorizontalAlignment="Left" on the definition of the column.
2. If you need a textbox, all you need to do is put inside DataGridTemplateColumn and put the TextBox inside.
|
|
|
|
|
HorizontalAlignment is not a property that can be used with DataGridCheckBoxColumn.
The TextBox approach with DataGridTemplateColumn worked sortof. Except, it doesn't fill the TextBox with the Binding List until you double click to edit the box. Then, it fills it in properly. How do you get it filled in in prior to entering edit mode?
<DataGrid.Columns>
<DataGridTextColumn
Header = "Zone #"
Width = "SizeToHeader"
Binding = "{Binding ZoneNum}"
IsReadOnly="true"/>
<DataGridTemplateColumn Header="Zone Description Text" Width="*">
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<TextBox Text ="{Binding ZoneDesc}" MaxLength="25"/>
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
for (byte i = 0; i < 64; i++)
{
zdentry.Add(new ZoneDescEntry()
{
ZoneNum = "Zone "+(i+1),
ZoneDesc = GlobalVars.User_Parameters.zonedescrip[i]
});
}
ZoneDescTable.ItemsSource = zdentry;
public class ZoneDescEntry
{
public string ZoneNum { get; set; }
public string ZoneDesc { get; set; }
}
|
|
|
|
|
Where do I put
<ListBox ItemTemplate="{StaticResource myItemsTemplate}" x:Name="ExternalAlarmTable" />
It will not compile if it is inside a grid, which I need to do like this.
<Grid Grid.Row="1" Name="EACB" ShowGridLines="True">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="70"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding ZoneNum}" Grid.Column="0" />
<CheckBox Grid.Column="1" IsChecked="{Binding ExternalAlarm}" />
</Grid>
And, how do I implement my c# back code, if I can't bind UI like you say. See previous reply.
|
|
|
|
|
I'm testing the integration of a user control in the hands of my application wpf, the problem is that my editor is a user control that contains multiple windows forms. I found the xaml code but adding it does not work because the control is composed of several other controls (windows forms, user control ...)
<"Xmlns: myeditor =" clr-namespace.myeditor.EditorForm ">
|
|
|
|
|
hi guys ..
now i start begin work in WP7 for Graduation Project
and the first time use wp7 in this project i need to control desktop of PC via windows phone 7 i need any body to help me how i can do it (control desktop)
and clarify way to right work
plz
|
|
|
|
|
Isn't this your graduation project? It's the chance for you to step up and show that, not only have you learned the basics of writing code, you've also learned how to do research on problems for yourself. It's the chance to really show that you know how to think for yourself and to apply logic and deductive reasoning.
How would I start? Well, I'd research controlling desktops; and I wouldn't limit myself to any existing solution that uses WP7. I'd also make sure that I was familiar with good programming practice in my target platform, and that I was aware of the limitations in that platform.
All I can say is, good luck.
|
|
|
|
|
i begin work in wp7 but i facing problem in control mouse i need tutorial ?
|
|
|
|