Can somone give example of Dependency Property in ViewModel in WPF passed as datacontext to view. Will this require inheriting from DependencyObject?
Lets say I want ListBox SelectedItem bound to a Dependency Property CurrentItem in ViewModel. I have it working from window object but same thing donnt work with ViewModel . In ViewMode...
Hello,
This is something I find rather curious, that a lot of third party libraries such as FileHelpers and Command Line Parser are designed to work at field level rather than property level.
Is there a particular reason why so many have chosen to target their tools at public fields rather than properties?
My personal feeling is that p...
I have created a class called ProductionDataUserControlBase and it derives from class UserControl. This base class has no XAML. Its purpose is to act as a base class for a grid that I encapsulate inside the class so that it can be modified when the class is inherited later. Inside the constructor of the base class, I also create the colu...
Hi,
I've been using Powershell-1.0 for command line needs for a while, instead of cmd.exe.
Unfortunately, there are still some caveats when using java.
I need to pass a property to a jar, like that:
java -jar -Duser.language=en any.jar
This line works fine in cmd.exe, but not in Powershell as it searches for another jar:
Unable to ...
Hi!
I know it is possible to retrieve a property name or a method with a return type. But is it also possible to get a method name without a return type via LINQ expression trees?
Example: string methodname = GetMethodname(x=>x.GetUser());
---> results: "GetUser"
...
Hi there,
I have a Classic ASP page that contains the following code to attempt a parametised query;
<%
Set cmdEmail = Server.CreateObject("ADODB.Command")
Set rsEmail = Server.CreateObject("ADODB.Recordset")
cmdEmail.CommandText = "SELECT * FROM VWTenantPropertiesResults WHERE ContentID = ?"
cmdEmail.CommandType = 1
cmdEmail.ActiveCon...
I use 'property' to ensure that changes to an objects instance variables are wrapped by methods where I need to.
What about when an instance has an variable that logically should not be changed? Eg, if I'm making a class for a Process, each Process instance should have a pid attribute that will frequently be accessed but should not be ...
I wonder, if it is possible to get currently used version of maven for filtering resource file.
I've a resource file, that is filtered by maven:
version=${project.version}
buildDate=${timestampFormatted}
buildBy=${user.name}
name=${project.artifactId}
buildVersion=${build.number}
osName=${os.name}
osArch=${os.arch}
osVersion=${os.versi...
hey,
guess I wanted to gernerate a commandline with flags and so on. Flags are of type bool but the commandline is a string like " /activeFlag". Is there a way to program a setter in C# which takes a bool but the getter returns a string?
like
private string activeFlag {
get { return activeFlag; }
set {
// the value here should b...
I have a custom class called "Parameter" and a custom activity with generic collection property called "Parameters", and I want to set bindings for one of Parameters in the generic list of Parameters Property,I've tried with activitybind, but it is not working, is there any way to do it with workflow foundation? please see codes below:
...
As you can seen in the diagram below there is a one-to-many relationship between the ProjectTask and Dependency table.
Entities tries to map every field in the View to fields in the Dependency table, which wouldn't work.
Any suggestions on how I can add the navigation property?
Thanks,
Abe
...
Hi to all!
I develop a custom control that have some field like below:
ControlKind, Field1 , Field2
I want to change attribute of one of field per controlKind,
Like: if controlKind == useField1, then Field1 show and Field2 hidde in properyGrid (or readonly or filter)
can i do it ?
Thanks in advance
...
private TextBlock _caption = new TextBlock();
public TextBlock Caption
{
get { return _caption; }
set { _caption = value; }
}
<l:CustomPanel>
<l:CustomPanel.Caption Text="Caption text" FontSize="18" Foreground="White" />
</l:CustomPanel>
Gives me the following error:
Cannot set properties on property elements....
It appears to me that except for a little syntactic sugar, property() does nothing good.
Sure, it's nice to be able to write a.b=2 instead of a.setB(2), but hiding the fact that a.b=2 isn't a simple assignment looks like a recipe for trouble, either because some unexpected result can happen, such as a.b=2 actually causes a.b to be 1. Or...
Is SearchString acting as property of Page class?
Here is code,
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
public string SearchString
{
get { return txtSearch.Text; }
}
</script>
<html...
Using the Typinfo unit, it is easy to enumerate properties as seen in the following snippet:
procedure TYRPropertiesMap.InitFrom(AClass: TClass; InheritLevel: Integer = 0);
var
propInfo: PPropInfo;
propCount: Integer;
propList: PPropList;
propType: PPTypeInfo;
pm: TYRPropertyMap;
classInfo: TClassInfo;
ix: Integer;
begin
...
I have a control mycontrol.ascx
This control has a property:
private GenericCollection<Item> myCollection;
public GenericCollection<Item> MyCollection
{
get { return myCollection; }
set { myCollection= value; }
}
Does anyone know how i could dynamically change from type Item to say type Product?
...
Can I set a private property via reflection?
public abstract class Entity
{
private int _id;
private DateTime? _createdOn;
public virtual T Id
{
get { return _id; }
private set { ChangePropertyAndNotify(ref _id, value, x => Id); }
}
public virtual DateTime? CreatedOn
{
get { return ...
Hi,
I'm trying to write a plugin that creates a ul-list. Got it to working, but I can't figure out how to se if it's already loaded. I believe it's due to that it creates a new instance each time I call it. Is there a way around this.
I use this code for the plugin:
$.fn.addResultList = function (options) {
var constructor = $('<...
Im trying to list all categories in a VPP-folder using a module from Meridium called FolderBrowserProperty. It works perfectly locally and on our company's remote test site, but on the live site we are getting the following error:
Server Error in '/' Application.
Unhandled Execution Error
Stack trace:
[HttpException: 0x80004005]<...