|
You should ask this in the lounge. Your question has nothing to do with WPF or Silverlight.
|
|
|
|
|
hi...
when write tcp channel in c# we add this reference (using System.Runtime.Remoting.Channels.Tcp;)...
i want ask if i want write TCP channel in wp7 what are i reference add ????
|
|
|
|
|
heba abu ghaleih22 wrote: what are i reference add ???
You will still need System.Runtime.Remoting.Channels (amongst others).
|
|
|
|
|
Hello,
I am new to WPF and am having a bit of trouble with a menu radio button item.
I have the following code snippets:
<Menu.Resources>
<ControlTemplate x:Key="Template" TargetType="{x:Type RadioButton}">
<Border Background="Transparent">
<MenuItem Header="{TemplateBinding Content}" IsCheckable="False" IsChecked="{TemplateBinding IsChecked}" IsHitTestVisible="False" Padding="2,3" HorizontalAlignment="Stretch">
</MenuItem>
</Border>
</ControlTemplate>
</Menu.Resources>
<MenuItem Header="Me">
<StackPanel>
<RadioButton Content="Foo" Template="{StaticResource Template}"/>
<RadioButton Content="Bar" Template="{StaticResource Template}"/>
<RadioButton Content="Biz" Template="{StaticResource Template}"/>
</StackPanel>
However, what ends up happening is that my check marks end up on the right side of the vertical menu separator as opposed to the left, as would happen normally using the IsChecked property.
Does anyone know a way to make these check marks appear to the LEFT of the vertical separator? All help is greatly appreciated.
|
|
|
|
|
I want to reuse some styles, so I created a resources file in the root of my project called AppResources.xaml.
I then copied the styles into it. At the top of my view, I replaced the styles with
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Common;component/AppResources.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
Yet I get a compile error "An error occured while finding the resource dictionary 'pack://application:,,,/Common;component/AppResources.xaml'".
What's the right way to do this?
[UPDATE] Fixed it with <resourcedictionary source="..\Resources.xaml">
If it's not broken, fix it until it is
|
|
|
|
|
If you want to access a resource which is in different assembly, then use the pack URI as follows...
Pack://application:,,,/SampleAssembly;component/SampleFolder1/SampleImage.jpg
If you want to merge two resource dictionaries use the following code
suppose if Dictionary1 and Dictionary2 are your resource xaml files, then to merge these resources
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Dictionary1.xaml" />
<ResourceDictionary Source="Dictionary2.xaml" />
</ResourceDictionary.MergedDictionaries>
<SolidColorBrush x:Key="BlueBrush" Color="Blue" />
</ResourceDictionary>
</Window.Resources>
|
|
|
|
|
i want to find out row number of a datagrid when i move mouse on it i.e. without clicking any row it must return the row number.
Tilak raheja
|
|
|
|
|
A quick look at the documentation[^] suggests the CellEnter and CellLeave events will give you what you need.
Programming is work, it isn't finger painting. Luc Pattyn
|
|
|
|
|
Hi,
I am trying to create stack bart chart in silver light with bars should come in horizental direction by following code
SeriesDefinition tempSeriesForSale1 = new SeriesDefinition();
tempSeriesForSale1.ItemsSource = saleUnits1;
tempSeriesForSale1.IndependentValuePath = "SalesDistrict";
tempSeriesForSale1.DependentValuePath = "saleFromOldCustomer";
//tempSeriesForSale1.Title = "Tik tik";
stackSeriesForSale.SeriesDefinitions.Add(tempSeriesForSale1);
Chart3.Series.Add(stackSeriesForSale);
With this code bars are coming in vertical direction. If I Interchange the Independentvaluepath and dependentvalue path then I gets exception.
Following is the code in .xaml file
<toolkit:Chart Name="Chart3" Title="Repeat Sales" VerticalAlignment="Top" Margin="33,330,176,0"
Height="262">
<toolkit:PieSeries ItemsSource="{Binding}" IndependentValuePath="Name"
DependentValuePath="Types" IsSelectionEnabled="True" >
</toolkit:PieSeries>
</toolkit:Chart>
Can someone please help?
Regards,
Vishal
|
|
|
|
|
[UPDATE] Got it working
I want to style a tooltip so that it looks like a Facebook tooltip[^].
In this design, there can be images, text, links, and buttons, as well as a little triangular pointer. So that leaves a couple of questions...
1) I was thinking that having multiple content presenters would allow me to define the style, and then when it's applied, set the image, text, links, etc. How do you set up multiple content presenters?
2) The triangular pointer... How do you get this to point to the correct spot depending on where the tooltip opens.
Thanks
K
If it's not broken, fix it until it is
|
|
|
|
|
Hi
I am basically trying to create a control that consists of a combobox and some buttons (add, clear etc). I realise I could do it by creating a usercontrol with some codebehind, but I am trying to achieve this by defining a custom control class and a style for the control.
I have done the below based on other custom controls I have done, but the issue I am having is that the ItemsSource is always null and never gets set.
[TemplatePart(Name = ComboBoxControl.INPUTCOMBOBOX_NAME, Type = typeof(ComboBox))]
public class ComboBoxControl : Control
{
#region Constants
const String CATEGORY_NAME = "Custom ComboBox Control";
const String INPUTCOMBOBOX_NAME = "PART_InputComboBox";
#endregion
#region Properties
ComboBox _inputComboBox;
#endregion
#region Dependency Properties
public static readonly DependencyProperty DisplayMemberPathProperty =
DependencyProperty.Register("DisplayMemberPath", typeof(string), typeof(ComboBoxControl), new UIPropertyMetadata(String.Empty));
public static readonly DependencyProperty ItemsSourceProperty =
DependencyProperty.Register("ItemsSource", typeof(IEnumerable), typeof(ComboBoxControl), new UIPropertyMetadata());
#endregion
#region Dependency Public Properties
public string DisplayMemberPath
{
get { return (string)GetValue(DisplayMemberPathProperty); }
set { SetValue(DisplayMemberPathProperty, value); }
}
public object ItemsSource
{
get { return (System.Collections.IEnumerable)GetValue(ItemsSourceProperty); }
set { SetValue(ItemsSourceProperty, value); }
}
#endregion
#region Constructor
public ComboBoxControl() { }
static ComboBoxControl()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(ComboBoxControl), new FrameworkPropertyMetadata(typeof(ComboBoxControl)));
}
#endregion
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
_inputComboBox = (ComboBox)GetTemplateChild(INPUTCOMBOBOX_NAME);
}
}
And the following style:
<Style TargetType="{x:Type local:ComboBoxControl}">
<Setter Property="Label" Value=""/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:ComboBoxControl}">
<Border>
<DockPanel>
<ComboBox x:Name="PART_InputComboBox" VerticalAlignment="Stretch" MinHeight="30"
DisplayMemberPath="{TemplateBinding DisplayMemberPath}"
ItemsSource="{Binding Path=ItemsSource, Mode=TwoWay, RelativeSource={RelativeSource Mode=FindAncestor,
AncestorType={x:Type local:ComboBoxControl}}, UpdateSourceTrigger=PropertyChanged}"/>
</DockPanel>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
NOTE: I have omitted irrelevant code.
And trying to set it like this:
<ctl:ComboBoxControl ItemsSource="{Binding Path=Users, Mode=TwoWay}"/>
But the value of the combobox itemsource is always null?!
Can anyone help please?
Thanks
|
|
|
|
|
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
|
|
|
|