Monday, October 1, 2012

Share...

I'm doing a research on how to setup a free sharepoint server to play with and study c# programming related  codes.

I came to this page which i think will help a newbie like me. http://maanehunden.wordpress.com/2011/11/30/sharepoint-2010-create-a-free-test-environment/

Now setting up..., will do an update once these instructions are okay. 10/01/2012 3:15 pm

Tuesday, August 7, 2012

WPF Style overriding


GLOBAL
--------------------------------------------------------------------------------
<Style BasedOn="{StaticResource {x:Type ListViewItem}}"
                    TargetType="ListViewItem">
            <Setter Property="VerticalContentAlignment" Value="Top" />
        </Style>

Use BasedOn to inherit from existing style, Then override only the line needed.


InLine
----------------------------------------------------------------------------------

<ListView.ItemContainerStyle>
                            <Style BasedOn="{StaticResource {x:Type ListViewItem}}"
                               TargetType="ListViewItem">
                                <Setter Property="VerticalContentAlignment" Value="Top" />
                            </Style>
                        </ListView.ItemContainerStyle>

Thursday, July 26, 2012

ClickOnce

ClickOnce allows you to deploy and updates application via IIS. Like a web page or web service, Windows application can now be deployed in servers and allowed to be consume by clients. 

Steps:

1.) Setup web server where installer can be viewed via http.
2.) Setup shared folder where application can publish the installer.
3.) Setup project's properties ---> Publish Tab ---> (Refer to screen shot).















4.) 2 options in updating client application. Before the application launch and after.
Before application launch, a pop-up message will appear if there is an update. a user can defer this update by selecting "skip" button or can proceed with the update by selecting "ok" button.

Forced update to client can also be implemented by setting the minimum version before publishing the installer.
















SETUP---------------------------------
IIS-------------------
-SiteName == SharedFolder

SiteName
http://sgurcmsap1rh:8088/
app pool to framework 4

sharedfolder
c:\sharedFolder
Share to everyone with read and write

CLICK ONCE----------------
publishing folder
\\SGURCMSAP1RH\EMRDeployment\

Installation folder url - -AssignPort 8088
http://sgurcmsap1rh:8088/

use only the root in the installation folder url
since no application is converted.

http://sgurcmsap1rh:8088/
not
http://sgurcmsap1rh:8088/RafflesEMRUAT.htm
---------------------------------------------------

Tuesday, March 20, 2012

AutoCompleteBox KeyPress

I was looking for ways to get enter key in an AutoCompleteBox. But no events supports it. Key Down event of AutoCompleteBox does not trigger the EnterKeyEvent.

Solution:

Create a custom NewAutoCompleteBox then inherit AutoCompleteBox.
Override OnKeyDown
Access the base.OnKeyDown(e); then this will trigger the enter key event.

        if(e.Key == Key.Enter) RaiseEnterKeyDownEvent();



Sunday, March 18, 2012

Expanded ListBoxItem's Width

This will allow element inside to expand its width. 
The key here is in red font. This will allow you to stretch the grid element inside the ListBox. 
-----------------------------------------------------------------------------------------------------
e.g (Maximize Grid element inside  <ListBox.ItemTemplate>  <DataTemplate>  </DataTemplate> </ListBox.ItemTemplate>)
<Grid Width="auto" >
            <Grid.Resources>               
                    <Style x:Key="listContainerStyle" TargetType="ListBoxItem">                     
                        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>                     
                    </Style>           
            </Grid.Resources> 

          <ListBox ScrollViewer.VerticalScrollBarVisibility="Auto" ItemContainerStyle="{StaticResource    listContainerStyle}" ScrollViewer.CanContentScroll="True" ItemsSource="{Binding Path=Model.Object}" Grid.ColumnSpan="2" Grid.Row="1"  Name="lstDiagnosis" >               
                <ListBox.ItemTemplate>                    
                    <DataTemplate>
                        <ListBoxItem HorizontalContentAlignment="Stretch">

                             <Grid Margin="2" >                           
                            <Grid.ColumnDefinitions >
                                <ColumnDefinition Width="50"></ColumnDefinition>
                                <ColumnDefinition Width="*"></ColumnDefinition>
                                <ColumnDefinition Width="*"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <TextBlock FontWeight="Bold" Text="{Binding Name}" Grid.Column="0" >
                            </TextBlock>
                            <TextBlock FontWeight="Bold" Text="{Binding Path=Description}"  Grid.Column="1">
                            </TextBlock>                            
                            <Button HorizontalAlignment="Right" VerticalContentAlignment="Center" VerticalAlignment="Center" Margin="0,0,2,0" Style="{x:Null}" Grid.Column="2"  FontWeight="Bold" FontSize="8" Tag="{Binding}" >
                                <TextBlock Text=" X " VerticalAlignment="Top" ></TextBlock>
                            </Button>
                        </Grid>
            </ListBoxItem>
            </DataTemplate>
            </ListBox.ItemTemplate>
            </ListBox>        
        </Grid>
----------------------------------------------------------------------------------------------------- 




Thursday, March 15, 2012

Self Titled

This is my first blog! :) Hope to enjoy it and if I do, I will create another one for my hobby which is photography. I created this blog to have a collection of information about my work. Latest technologies, codes, programming techniques, software architecture and design, web, windows, tablet and mobile application, gadgets, internet, but not limited to software development. basically everything about 0's and 1's.

This doesn't mean that I'm a savvy with technology, it's just that I need to learn and store more info as possible to survive in this field. This blog will serve as a reference and library of informations from day to day work.