|
i am not able to buy any book do u have any other option
|
|
|
|
|
Start here[^].
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
Visit the Hindi forum here.
|
|
|
|
|
run kase karna hai project ko
|
|
|
|
|
awinash kr wrote: run kase karna hai project ko
I would suggest you use the Indian forum[^] to post your questions in Hindi from next time.
This is a general forum and many users will not understand what you typed in this post.
To run a Silverlight project you need the Silverlight runtime and SDK's[^] installed on your machine along with VS2008 / 2010.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
Visit the Hindi forum here.
|
|
|
|
|
|
Seriously? You couldn't figure out how to get started by simply clicking around in the Visual Studio menu? Beyond that, you don't know about google? Have you been living under a rock?
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
I have the following custom UserControl:
<UserControl x:Class="ReportIt.Controls.UICControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:diag="clr-namespace:System.Diagnostics;assembly=WindowsBase">
<StackPanel Margin="0">
<StackPanel.Resources>
<Style TargetType="TextBox">
<Setter Property="MinWidth"
Value="55" />
<Setter Property="MaxWidth"
Value="60" />
<Setter Property="Margin"
Value="0,0,5,0" />
</Style>
</StackPanel.Resources>
<GroupBox Header="{Binding Path=UICTypeLabel}"
Margin="0,10">
</GroupBox>
</StackPanel>
</UserControl>
Here is the referenced DependencyProperty:
public static DependencyProperty UICTypeLabelProperty =
DependencyProperty.RegisterAttached("UICTypeLabel", typeof(string), typeof(UICControl), new PropertyMetadata(String.Empty));
public string UICTypeLabel
{
get
{
return (string)GetValue(UICTypeLabelProperty);
}
set
{
SetValue(UICTypeLabelProperty, value);
}
}
And here is the usage:
<controls:UICControl Margin="0"
x:Name="uicResponsibleControl"
Incident="{Binding Path=AtbIncident}"
ReportingStructure="{Binding Path=AtbIncident.AtbIncidentReportingStructures}"
UICType="R"
UICTypeLabel="Responsible" />
But I'm not seeing "Responsible" when the control presents itself on the display. What am I doing wrong?
I am also seeing this error message in the Output window:
System.Windows.Data Error: 39 : BindingExpression path error: 'UICTypeLabel' property not found on 'object' ''BasicViewContext' (HashCode=13769489)'. BindingExpression:Path=UICTypeLabel; DataItem='BasicViewContext' (HashCode=13769489); target element is 'GroupBox' (Name=''); target property is 'Header' (type 'Object')
BasicView is the XAML window that is using the control.
Thanks
Phil
-- Modified Thursday, August 26, 2010 3:11 PM
|
|
|
|
|
Because the GroupBox is looking for "UICTypeLabel" on its DataContext, not on the UserControl. You need to tell it where to look.
Header="{Binding UICTypeLabel,RelativeSource={RelativeSource FindAncestor,AncestorType=UserControl}}"
(Might have to use {x:Type UserControl} in there... I forget whether it's necessary)
|
|
|
|
|
Oh man - you are awesome!!!!
Phil
|
|
|
|
|
Hey guys,
I'm planning to develop a multimedia application in WPF. The application will be able to play video's, audio and pictures.
I want to 'move' the pictures over the screen to display them in a fancy way. Video's will 'switch' back to back. I wonder if this will perform well, does anyone have an opinion?
Thanks!
|
|
|
|
|
Eduard Keilholz wrote: I want to 'move' the pictures over the screen to display them in a fancy way
See this[^] or this[^].
CompositionTarget.Rendering does provides some ways to handle animations.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
Visit the Hindi forum here.
|
|
|
|
|
I have a datagrid that is sortable by clicking on the headers. I want to print the datagrid with the same sorting as is currently being viewed. How can I get the current sorting scheme from the datagrid control?
Thanks
Brent
|
|
|
|
|
One way to do this is to use an ICollectionView or PagedCollectionView .
See here[^] for an example.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
Visit the Hindi forum here.
|
|
|
|
|
I have a paged collection view, but it doesn't have any property or method that returns the sorted list. Do I have to just have to decode the sort description myself and apply it to the items in the source? Or am I missing something?
Brent
|
|
|
|
|
OK I found the
GetItemAt method that returns each item one by one in the sorted order. Since I need it one by one for printing multiple pages in silverlight, that should work for me I think.
Brent
|
|
|
|
|
I'm looking to inherit from some standard WPF controls, including windows, buttons and a few others. I wish to add some functionality to them that will be common between several controls. My plan was to create an interface for the common functionality, and implement this interface on the required controls. The problem i am getting is that i cannot specify an access modifier on the interface implementations so that they are made available as designer editable properties.
For example i created an interface as follows:
public interface iSecurityControled
{
SecuritySettings.ProgramAreas ProgramArea { get; set; }
SecuritySettings.DisabledActions DisabledAction { get; set; }
}
public class SecuritySettings
{
public enum ProgramAreas
{
None,
Client,
Development,
Block,
Accounts
}
public enum DisabledActions
{
None,
Hide,
Disable
}
}
I then created a class inheriting from the WPF window class and implemented the above interface
public class Form:System.Windows.Window, Interfaces.iSecurityControled
{
#region iSecurityControled Members
private SecuritySettings.ProgramAreas _ProgramArea = SecuritySettings.ProgramAreas.None;
SecuritySettings.ProgramAreas iSecurityControled.ProgramArea
{
get
{
return _ProgramArea;
}
set
{
_ProgramArea = value;
}
}
private SecuritySettings.DisabledActions _DisabledAction = SecuritySettings.DisabledActions.None;
SecuritySettings.DisabledActions iSecurityControled.DisabledAction
{
get
{
return _DisabledAction;
}
set
{
_DisabledAction = value;
}
}
public int MyProperty { get; set; }
#endregion
}
My problem is that if i add the public modifier to the properties i get the following error message:
The modifier 'public' is not valid for this item.
I have tried to add the public modifier to the interface declaration and get the same error. This means that the property is not visible in the designer, however the MyProperty is. To sanity check my thinking i have re done this code as a standard winforms project and it works just as i want it to.
Not sure if this will be of any use but it is possible to use the following code to set the properties,
((iSecurityControled)this).DisabledAction = SecuritySettings.DisabledActions.Disable;
but this is not achieving the design time way of working that i am aiming to achieve.
If any one could point me in the direction of a solution it would be greatly appreciated.
|
|
|
|
|
Change
SecuritySettings.DisabledActions iSecurityControled.DisabledAction {
get { return _DisabledAction; }
set { _DisabledAction = value; }
} to
public SecuritySettings.DisabledActions DisabledAction {
get { return _DisabledAction; }
set { _DisabledAction = value; }
} You need to do the same for the other property as well. Basically, you've supplied an explicit interface definition there - when an implicit one will suit your needs.
|
|
|
|
|
thanks for the quick and helpful response. Your solution worked a treat.
I guess as WPF is new to me i was assuming it was to blame for something that was just a simple mistake of mine.
|
|
|
|
|
Don't worry about it - we all started off fearing WPF; soon the love comes.
|
|
|
|
|
I have a small button placed upon a bigger button. Both buttons have their own style. Both buttons work independently with their IsMouseOver/IsPressed styles. My requirement is that Click on big/small button should evoke both buttons, also mouseEnter/Leave on big button should evoke both buttons. As small button is placed on big button and user will not be able to see that there are two buttons, mouseLeave/Enter on small button should not evoke a new response.
I don't want to make any change in styles, because that will complicate the thing. I can make change in XAML where i am setting the style or in the code-behind CS file. I assume that it is possible with XAML only, and without writing any code in C#.
A reply with a bit code(XAML/C#) will help a lot.
modified on Wednesday, August 25, 2010 4:40 AM
|
|
|
|
|
Hi,
I have listView, which has a GridView Column ,having DataTemplate which has ComboBox, I m binding the listview's Colums using a collection , but this combo alone with another collection . But its not working .
//resource
<objectdataprovider x:key="myList" objecttype="{x:Type local:NameList}">
<listview>...
<gridviewcolumn.celltemplate>
<datatemplate x:name="myDataTemp">
<combobox x:name="Web_Combo" selectedvalue="{Binding Path=MatchedValue, Mode=TwoWay}"
="" itemssource="{Binding Source={StaticResource myList}}" width="100" height="25">
code :
namespace N
{
public class NameList : List<string>
{
public NameList()
{
//this.Add("Name");
//this.Add("Name1");
}
}
public partial class Window5 : Window
{
public NameList pp
{
get;set;
}
public Window5()
{
this.InitializeComponent();
pp = new NameList();
pp.Add("dfgdf");
pp.Add("ggf");
}
}
}
Here if i hard code values inside consturctor its working , if i create object of this class and add items to it. its not binding.
pl let me know how to bind the object of the colletion to combo
thanks
|
|
|
|
|
You're adding elements to the wrong list. You need to get a reference to "myList" and add the elements to that, not create a new one in the code-behind.
Check out the FindResource function, and use that to get "myList".
|
|
|
|
|
Thanks for the info, It worked after I use FindResource.
But I have one more trouble, I have a button called ResetAll, Onclick of it, should reset all the Combo indexs to 0 or -1 in the listview. As the combo is built added part of datatemplate in each listview item. Can u throw me a way to do this. pl find the reference code below
Xmal :
<usercontrol.resources>
<objectdataprovider x:key="myList" objecttype="{x:Type local:NameList}">
<objectdataprovider x:key="myList" objecttype="{x:Type local:TaskList}">
<grid>
<listview x:name="ListView_Web" selectionmode="Single"
datacontext="{Binding Source={StaticResource TaskList}}"
issynchronizedwithcurrentitem="True" itemssource="{Binding}"
alternationcount="2" background="#FFD9D9D9">
<listview.view>
<gridview columnheadercontainerstyle="{DynamicResource CustomHeaderStyle}"> <gridviewcolumn header="Name" width="70" displaymemberbinding="{Binding Path=Name}">
<gridviewcolumn header="Age" width="100" displaymemberbinding="{Binding Path=EmpdId}">
<gridviewcolumn header="StateList" width="150">
<gridviewcolumn.celltemplate>
<datatemplate x:name="myDataTemp">
<combobox selectedvalue="{Binding Path=SelectedValue, Mode=TwoWay}"
="" itemssource="{Binding Source={StaticResource myList}, Mode=OneWay}" width="100" height="25">
Code :
Namespace N
{
public class NameList : List<string>
{
public NameList()
{
}
}
public class Window1
{
Window1()
{
ObjectDataProvider objectDataProvider = this.TryFindResource("myList") as ObjectDataProvider;
NameList nameList = objectDataProvider.Data as NameList;
AddItemsToCombo(ref nameList );//this adds items to combo from webserivce
}
On_ResetButtonClick()
{
//How do I reset the comboItems of each listview item.
}
}
Thanks in adavance
|
|
|
|
|
You shouldn't be trying to edit the combo boxes directly, especially if they're in a DataTemplate.
Instead, go to whatever they're bound to, and set THAT to null. If your binding is correct, the combos will automatically update themselves.
Remember that either the bound object needs to implement INotifyPropertyChanged, or the bound property has to be a DependencyProperty... Otherwise the binding won't be triggered.
|
|
|
|
|
Use merged resource dictionaries. See here[^].
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
Visit the Hindi forum here.
|
|
|
|