I have been given complex requirements for a line chart. Here it is mocked-up manually in Excel:
Using Cognos Analytics 11.0.13, but plan to upgrade to 11.1.7 soon.
I want to draw a line chart with two lines. Using the samples data from Cognos, the chart will show Revenue as the measure, Date along the x-axis, and Order Method Type as the line color. At this point, which colors are used is not critical. Also, show all days even if there is no data. Sounds simple so far.
The tricky bits:
If it's a weekend the line should be dashed, otherwise it should be solid.
If Region is Americas, the marker should be green, otherwise it should be red.
Can this be done natively in Cognos, or am I looking at developing a Custom Control using d3?
Here's the current state of the attempt:
<report xmlns="http://developer.cognos.com/schemas/report/14.3/" expressionLocale="en" useStyleVersion="11.4">
<drillBehavior/>
<layouts>
<layout>
<reportPages>
<page name="Page1">
<style>
<defaultStyles>
<defaultStyle refStyle="pg"/>
</defaultStyles>
</style>
<pageBody>
<style>
<defaultStyles>
<defaultStyle refStyle="pb"/>
</defaultStyles>
</style>
<contents>
<v2_combinationChart maxHotspots="10000" name="Combination chart1" refQuery="output">
<v2_combinationTypeTooltips/>
<v2_legend>
<v2_legendPosition>
<v2_legendPreset/>
</v2_legendPosition>
<v2_legendTitle refQuery="output">
<v2_chartTextContents>
<v2_automaticText/>
</v2_chartTextContents>
<style>
<defaultStyles>
<defaultStyle refStyle="lx"/>
</defaultStyles>
</style>
</v2_legendTitle>
<style>
<defaultStyles>
<defaultStyle refStyle="lg"/>
</defaultStyles>
</style>
</v2_legend>
<v2_commonAxis>
<v2_ordinalAxis>
<v2_axisTitle refQuery="output">
<v2_chartTextContents>
<v2_automaticText/>
</v2_chartTextContents>
<style>
<defaultStyles>
<defaultStyle refStyle="at"/>
</defaultStyles>
</style>
</v2_axisTitle>
<v2_axisLine lineWeight="0"/>
<v2_axisLabels>
<style>
<defaultStyles>
<defaultStyle refStyle="al"/>
</defaultStyles>
</style>
</v2_axisLabels>
<v2_labelControl/>
</v2_ordinalAxis>
<chartNodes>
<chartNode>
<chartNodeMembers>
<chartNodeMember refDataItem="Date">
<chartContents>
<chartTextItem>
<dataSource>
<memberCaption/>
</dataSource>
</chartTextItem>
</chartContents>
<sortList>
<sortItem refDataItem="Date" sortOrder="ascending"/>
</sortList>
<propertyList>
<propertyItem refDataItem="Region"/>
</propertyList>
</chartNodeMember>
</chartNodeMembers>
</chartNode>
</chartNodes>
</v2_commonAxis>
<v2_topLeftAxis>
<v2_combinationChartTypes>
<v2_line lineDisplayType="lineAndMarkers">
<v2_linePalette markerSize="5pt">
<v2_linePaletteEntries>
<v2_linePaletteEntry>
<v2_lineFill defaultColor="#8599D3">
<v2_linearGradient>
<v2_gradientColor gradientColor="#8599D3"/>
<v2_gradientColor colorPosition="100" gradientColor="#5876AE"/>
</v2_linearGradient>
</v2_lineFill>
<v2_pointPaletteEntry>
<v2_fillEffect>
<v2_linearGradient>
<v2_gradientColor gradientColor="#8599D3"/>
<v2_gradientColor colorPosition="100" gradientColor="#5876AE"/>
</v2_linearGradient>
</v2_fillEffect>
</v2_pointPaletteEntry>
</v2_linePaletteEntry>
<v2_linePaletteEntry>
<v2_lineFill defaultColor="#E3AE6C">
<v2_linearGradient>
<v2_gradientColor gradientColor="#E3AE6C"/>
<v2_gradientColor colorPosition="100" gradientColor="#CD854E"/>
</v2_linearGradient>
</v2_lineFill>
<v2_pointPaletteEntry>
<v2_fillEffect>
<v2_linearGradient>
<v2_gradientColor gradientColor="#E3AE6C"/>
<v2_gradientColor colorPosition="100" gradientColor="#CD854E"/>
</v2_linearGradient>
</v2_fillEffect>
</v2_pointPaletteEntry>
</v2_linePaletteEntry>
<v2_linePaletteEntry>
<v2_lineFill defaultColor="#839862">
<v2_linearGradient>
<v2_gradientColor gradientColor="#839862"/>
<v2_gradientColor colorPosition="100" gradientColor="#6C7F56"/>
</v2_linearGradient>
</v2_lineFill>
<v2_pointPaletteEntry>
<v2_fillEffect>
<v2_linearGradient>
<v2_gradientColor gradientColor="#839862"/>
<v2_gradientColor colorPosition="100" gradientColor="#6C7F56"/>
</v2_linearGradient>
</v2_fillEffect>
</v2_pointPaletteEntry>
</v2_linePaletteEntry>
<v2_linePaletteEntry>
<v2_lineFill defaultColor="#B7C873">
<v2_linearGradient>
<v2_gradientColor gradientColor="#B7C873"/>
<v2_gradientColor colorPosition="100" gradientColor="#AFB885"/>
</v2_linearGradient>
</v2_lineFill>
<v2_pointPaletteEntry>
<v2_fillEffect>
<v2_linearGradient>
<v2_gradientColor gradientColor="#B7C873"/>
<v2_gradientColor colorPosition="100" gradientColor="#AFB885"/>
</v2_linearGradient>
</v2_fillEffect>
</v2_pointPaletteEntry>
</v2_linePaletteEntry>
<v2_linePaletteEntry>
<v2_lineFill defaultColor="#8484A8">
<v2_linearGradient>
<v2_gradientColor gradientColor="#8484A8"/>
<v2_gradientColor colorPosition="100" gradientColor="#525E7E"/>
</v2_linearGradient>
</v2_lineFill>
<v2_pointPaletteEntry>
<v2_fillEffect>
<v2_linearGradient>
<v2_gradientColor gradientColor="#8484A8"/>
<v2_gradientColor colorPosition="100" gradientColor="#525E7E"/>
</v2_linearGradient>
</v2_fillEffect>
</v2_pointPaletteEntry>
</v2_linePaletteEntry>
<v2_linePaletteEntry>
<v2_lineFill defaultColor="#C0CCED">
<v2_linearGradient>
<v2_gradientColor gradientColor="#C0CCED"/>
<v2_gradientColor colorPosition="100" gradientColor="#B0C2E5"/>
</v2_linearGradient>
</v2_lineFill>
<v2_pointPaletteEntry>
<v2_fillEffect>
<v2_linearGradient>
<v2_gradientColor gradientColor="#C0CCED"/>
<v2_gradientColor colorPosition="100" gradientColor="#B0C2E5"/>
</v2_linearGradient>
</v2_fillEffect>
</v2_pointPaletteEntry>
</v2_linePaletteEntry>
<v2_linePaletteEntry>
<v2_lineFill defaultColor="#8C5580">
<v2_linearGradient>
<v2_gradientColor gradientColor="#8C5580"/>
<v2_gradientColor colorPosition="100" gradientColor="#794067"/>
</v2_linearGradient>
</v2_lineFill>
<v2_pointPaletteEntry>
<v2_fillEffect>
<v2_linearGradient>
<v2_gradientColor gradientColor="#8C5580"/>
<v2_gradientColor colorPosition="100" gradientColor="#794067"/>
</v2_linearGradient>
</v2_fillEffect>
</v2_pointPaletteEntry>
</v2_linePaletteEntry>
<v2_linePaletteEntry>
<v2_lineFill defaultColor="#C789BC">
<v2_linearGradient>
<v2_gradientColor gradientColor="#C789BC"/>
<v2_gradientColor colorPosition="100" gradientColor="#BB72BC"/>
</v2_linearGradient>
</v2_lineFill>
<v2_pointPaletteEntry>
<v2_fillEffect>
<v2_linearGradient>
<v2_gradientColor gradientColor="#C789BC"/>
<v2_gradientColor colorPosition="100" gradientColor="#BB72BC"/>
</v2_linearGradient>
</v2_fillEffect>
</v2_pointPaletteEntry>
</v2_linePaletteEntry>
<v2_linePaletteEntry>
<v2_lineFill defaultColor="#D5BAEF">
<v2_linearGradient>
<v2_gradientColor gradientColor="#D5BAEF"/>
<v2_gradientColor colorPosition="100" gradientColor="#C29FD1"/>
</v2_linearGradient>
</v2_lineFill>
<v2_pointPaletteEntry>
<v2_fillEffect>
<v2_linearGradient>
<v2_gradientColor gradientColor="#D5BAEF"/>
<v2_gradientColor colorPosition="100" gradientColor="#C29FD1"/>
</v2_linearGradient>
</v2_fillEffect>
</v2_pointPaletteEntry>
</v2_linePaletteEntry>
<v2_linePaletteEntry>
<v2_lineFill defaultColor="#83683F">
<v2_linearGradient>
<v2_gradientColor gradientColor="#83683F"/>
<v2_gradientColor colorPosition="100" gradientColor="#604926"/>
</v2_linearGradient>
</v2_lineFill>
<v2_pointPaletteEntry>
<v2_fillEffect>
<v2_linearGradient>
<v2_gradientColor gradientColor="#83683F"/>
<v2_gradientColor colorPosition="100" gradientColor="#604926"/>
</v2_linearGradient>
</v2_fillEffect>
</v2_pointPaletteEntry>
</v2_linePaletteEntry>
<v2_linePaletteEntry>
<v2_lineFill defaultColor="#DCB05A">
<v2_linearGradient>
<v2_gradientColor gradientColor="#DCB05A"/>
<v2_gradientColor colorPosition="100" gradientColor="#C09C52"/>
</v2_linearGradient>
</v2_lineFill>
<v2_pointPaletteEntry>
<v2_fillEffect>
<v2_linearGradient>
<v2_gradientColor gradientColor="#DCB05A"/>
<v2_gradientColor colorPosition="100" gradientColor="#C09C52"/>
</v2_linearGradient>
</v2_fillEffect>
</v2_pointPaletteEntry>
</v2_linePaletteEntry>
<v2_linePaletteEntry>
<v2_lineFill defaultColor="#F4DF9E">
<v2_linearGradient>
<v2_gradientColor gradientColor="#F4DF9E"/>
<v2_gradientColor colorPosition="100" gradientColor="#E4CF87"/>
</v2_linearGradient>
</v2_lineFill>
<v2_pointPaletteEntry>
<v2_fillEffect>
<v2_linearGradient>
<v2_gradientColor gradientColor="#F4DF9E"/>
<v2_gradientColor colorPosition="100" gradientColor="#E4CF87"/>
</v2_linearGradient>
</v2_fillEffect>
</v2_pointPaletteEntry>
</v2_linePaletteEntry>
<v2_linePaletteEntry>
<v2_lineFill defaultColor="#5F8A8C">
<v2_linearGradient>
<v2_gradientColor gradientColor="#5F8A8C"/>
<v2_gradientColor colorPosition="100" gradientColor="#537579"/>
</v2_linearGradient>
</v2_lineFill>
<v2_pointPaletteEntry>
<v2_fillEffect>
<v2_linearGradient>
<v2_gradientColor gradientColor="#5F8A8C"/>
<v2_gradientColor colorPosition="100" gradientColor="#537579"/>
</v2_linearGradient>
</v2_fillEffect>
</v2_pointPaletteEntry>
</v2_linePaletteEntry>
<v2_linePaletteEntry>
<v2_lineFill defaultColor="#96C4B2">
<v2_linearGradient>
<v2_gradientColor gradientColor="#96C4B2"/>
<v2_gradientColor colorPosition="100" gradientColor="#89B0A0"/>
</v2_linearGradient>
</v2_lineFill>
<v2_pointPaletteEntry>
<v2_fillEffect>
<v2_linearGradient>
<v2_gradientColor gradientColor="#96C4B2"/>
<v2_gradientColor colorPosition="100" gradientColor="#89B0A0"/>
</v2_linearGradient>
</v2_fillEffect>
</v2_pointPaletteEntry>
</v2_linePaletteEntry>
<v2_linePaletteEntry>
<v2_lineFill defaultColor="#CBE8E7">
<v2_linearGradient>
<v2_gradientColor gradientColor="#CBE8E7"/>
<v2_gradientColor colorPosition="100" gradientColor="#BDD6D5"/>
</v2_linearGradient>
</v2_lineFill>
<v2_pointPaletteEntry>
<v2_fillEffect>
<v2_linearGradient>
<v2_gradientColor gradientColor="#CBE8E7"/>
<v2_gradientColor colorPosition="100" gradientColor="#BDD6D5"/>
</v2_linearGradient>
</v2_fillEffect>
</v2_pointPaletteEntry>
</v2_linePaletteEntry>
<v2_linePaletteEntry>
<v2_lineFill defaultColor="#AE6564">
<v2_linearGradient>
<v2_gradientColor gradientColor="#AE6564"/>
<v2_gradientColor colorPosition="100" gradientColor="#875352"/>
</v2_linearGradient>
</v2_lineFill>
<v2_pointPaletteEntry>
<v2_fillEffect>
<v2_linearGradient>
<v2_gradientColor gradientColor="#AE6564"/>
<v2_gradientColor colorPosition="100" gradientColor="#875352"/>
</v2_linearGradient>
</v2_fillEffect>
</v2_pointPaletteEntry>
</v2_linePaletteEntry>
<v2_linePaletteEntry>
<v2_lineFill defaultColor="#D88C6F">
<v2_linearGradient>
<v2_gradientColor gradientColor="#D88C6F"/>
<v2_gradientColor colorPosition="100" gradientColor="#C47D61"/>
</v2_linearGradient>
</v2_lineFill>
<v2_pointPaletteEntry>
<v2_fillEffect>
<v2_linearGradient>
<v2_gradientColor gradientColor="#D88C6F"/>
<v2_gradientColor colorPosition="100" gradientColor="#C47D61"/>
</v2_linearGradient>
</v2_fillEffect>
</v2_pointPaletteEntry>
</v2_linePaletteEntry>
<v2_linePaletteEntry>
<v2_lineFill defaultColor="#E3C9B0">
<v2_linearGradient>
<v2_gradientColor gradientColor="#E3C9B0"/>
<v2_gradientColor colorPosition="100" gradientColor="#D2B2A5"/>
</v2_linearGradient>
</v2_lineFill>
<v2_pointPaletteEntry>
<v2_fillEffect>
<v2_linearGradient>
<v2_gradientColor gradientColor="#E3C9B0"/>
<v2_gradientColor colorPosition="100" gradientColor="#D2B2A5"/>
</v2_linearGradient>
</v2_fillEffect>
</v2_pointPaletteEntry>
</v2_linePaletteEntry>
<v2_linePaletteEntry>
<v2_lineFill defaultColor="#848484">
<v2_linearGradient>
<v2_gradientColor gradientColor="#848484"/>
<v2_gradientColor colorPosition="100" gradientColor="#555555"/>
</v2_linearGradient>
</v2_lineFill>
<v2_pointPaletteEntry>
<v2_fillEffect>
<v2_linearGradient>
<v2_gradientColor gradientColor="#848484"/>
<v2_gradientColor colorPosition="100" gradientColor="#555555"/>
</v2_linearGradient>
</v2_fillEffect>
</v2_pointPaletteEntry>
</v2_linePaletteEntry>
<v2_linePaletteEntry>
<v2_lineFill defaultColor="#a4a4a4">
<v2_linearGradient>
<v2_gradientColor gradientColor="#a4a4a4"/>
<v2_gradientColor colorPosition="100" gradientColor="#909090"/>
</v2_linearGradient>
</v2_lineFill>
<v2_pointPaletteEntry>
<v2_fillEffect>
<v2_linearGradient>
<v2_gradientColor gradientColor="#a4a4a4"/>
<v2_gradientColor colorPosition="100" gradientColor="#909090"/>
</v2_linearGradient>
</v2_fillEffect>
</v2_pointPaletteEntry>
</v2_linePaletteEntry>
<v2_linePaletteEntry>
<v2_lineFill defaultColor="#C7C7C7">
<v2_linearGradient>
<v2_gradientColor gradientColor="#C7C7C7"/>
<v2_gradientColor colorPosition="100" gradientColor="#c1c1c1"/>
</v2_linearGradient>
</v2_lineFill>
<v2_pointPaletteEntry>
<v2_fillEffect>
<v2_linearGradient>
<v2_gradientColor gradientColor="#C7C7C7"/>
<v2_gradientColor colorPosition="100" gradientColor="#c1c1c1"/>
</v2_linearGradient>
</v2_fillEffect>
</v2_pointPaletteEntry>
</v2_linePaletteEntry>
</v2_linePaletteEntries>
</v2_linePalette>
<v2_conditionalLinePalette showInLegend="hide">
<v2_lineAdvancedCondition>
<v2_lineCases>
<v2_lineCase>
<v2_conditionalPaletteEntryLabel>
<v2_automaticLabel/>
</v2_conditionalPaletteEntryLabel>
<reportCondition>_day_of_week ([output].[Date],1) in (6,7) and [output].[Order method type]='E-mail' and [output].[Region] = 'Americas'</reportCondition>
<v2_linePaletteEntry lineStyle="dash">
<v2_lineFill defaultColor="#198545">
<v2_color color="#8599D3"/>
</v2_lineFill>
<v2_pointPaletteEntry markerShape="circle">
<v2_fillEffect defaultColor="#198545">
<v2_solidColor color="blue"/>
</v2_fillEffect>
</v2_pointPaletteEntry>
</v2_linePaletteEntry>
</v2_lineCase>
</v2_lineCases>
</v2_lineAdvancedCondition>
<v2_lineAdvancedCondition>
<v2_lineCases>
<v2_lineCase>
<reportCondition>_day_of_week ([output].[Date],1) in (6,7) and [output].[Order method type]='Telephone' and [output].[Region] = 'Americas'</reportCondition>
<v2_linePaletteEntry lineStyle="dash">
<v2_lineFill defaultColor="#198545">
<v2_color color="#E3AE6C"/>
</v2_lineFill>
<v2_pointPaletteEntry markerShape="circle">
<v2_fillEffect defaultColor="#198545">
<v2_solidColor color="blue"/>
</v2_fillEffect>
</v2_pointPaletteEntry>
</v2_linePaletteEntry>
</v2_lineCase>
</v2_lineCases>
</v2_lineAdvancedCondition>
</v2_conditionalLinePalette>
<chartNodes>
<chartNode>
<chartNodeMembers>
<chartNodeMember refDataItem="Order method type">
<chartContents>
<chartTextItem>
<dataSource>
<memberCaption/>
</dataSource>
</chartTextItem>
</chartContents>
</chartNodeMember>
</chartNodeMembers>
</chartNode>
</chartNodes>
</v2_line>
</v2_combinationChartTypes>
<v2_axis>
<v2_axisTitle refQuery="output">
<v2_chartTextContents>
<v2_automaticText/>
</v2_chartTextContents>
<style>
<defaultStyles>
<defaultStyle refStyle="at"/>
</defaultStyles>
</style>
</v2_axisTitle>
<v2_axisLine lineWeight="0"/>
<v2_axisRange>
<v2_automaticRange/>
</v2_axisRange>
<v2_axisLabels>
<style>
<defaultStyles>
<defaultStyle refStyle="al"/>
</defaultStyles>
</style>
</v2_axisLabels>
<v2_majorGridlines lineWeight="0" lineColor="#CCCCCC"/>
</v2_axis>
</v2_topLeftAxis>
<style>
<defaultStyles>
<defaultStyle refStyle="ch"/>
</defaultStyles>
<CSS value="width:1054px;height:365px"/>
</style>
<noDataHandler>
<contents>
<block>
<contents>
<textItem>
<dataSource>
<staticValue>No Data Available</staticValue>
</dataSource>
</textItem>
</contents>
<style>
<CSS value="padding:16px;"/>
</style>
</block>
</contents>
</noDataHandler>
<v2_defaultChartMeasure refDataItem="Revenue"/>
</v2_combinationChart>
</contents>
</pageBody>
</page>
</reportPages>
</layout>
</layouts>
<queries>
<query name="source">
<source>
<model/>
</source>
<selection>
<dataItem aggregate="total" name="Revenue">
<expression>[Sales (query)].[Sales].[Revenue]</expression>
<XMLAttributes>
<XMLAttribute output="no" name="RS_dataType" value="2"/>
<XMLAttribute output="no" name="RS_dataUsage" value="2"/>
<XMLAttribute output="no" name="RS_isCurrency" value="true"/>
</XMLAttributes>
</dataItem>
<dataItem aggregate="none" rollupAggregate="none" name="Date">
<expression>[Sales (query)].[Time].[Date]</expression>
<XMLAttributes>
<XMLAttribute output="no" name="RS_dataType" value="4"/>
<XMLAttribute output="no" name="RS_dataUsage" value="0"/>
</XMLAttributes>
</dataItem>
<dataItem aggregate="none" rollupAggregate="none" name="Day of the week">
<expression>[Sales (query)].[Time].[Day of the week]</expression>
<XMLAttributes>
<XMLAttribute output="no" name="RS_dataType" value="1"/>
<XMLAttribute output="no" name="RS_dataUsage" value="0"/>
</XMLAttributes>
</dataItem>
<dataItem aggregate="none" rollupAggregate="none" name="Order method type">
<expression>[Sales (query)].[Order method].[Order method type]</expression>
<XMLAttributes>
<XMLAttribute output="no" name="RS_dataType" value="3"/>
<XMLAttribute output="no" name="RS_dataUsage" value="0"/>
</XMLAttributes>
</dataItem>
<dataItem name="Region" aggregate="none" rollupAggregate="none">
<expression>[Sales (query)].[Retailers].[Region]</expression>
<XMLAttributes>
<XMLAttribute name="RS_dataType" value="3" output="no"/>
<XMLAttribute name="RS_dataUsage" value="0" output="no"/>
</XMLAttributes>
</dataItem>
<dataItem name="join" aggregate="none">
<expression>'a'</expression>
</dataItem>
</selection>
<detailFilters>
<detailFilter>
<filterExpression>[Order method type] in ('E-mail','Telephone')</filterExpression>
</detailFilter>
<detailFilter>
<filterExpression>[Date]<= 2010-02-28</filterExpression>
</detailFilter>
</detailFilters>
</query>
<query name="date">
<source>
<model/>
</source>
<selection>
<dataItem aggregate="none" rollupAggregate="none" name="Date">
<expression>[Sales (query)].[Time].[Date]</expression>
<XMLAttributes>
<XMLAttribute output="no" name="RS_dataType" value="4"/>
<XMLAttribute output="no" name="RS_dataUsage" value="0"/>
</XMLAttributes>
</dataItem>
<dataItem aggregate="none" rollupAggregate="none" name="Day of the week">
<expression>[Sales (query)].[Time].[Day of the week]</expression>
<XMLAttributes>
<XMLAttribute output="no" name="RS_dataType" value="1"/>
<XMLAttribute output="no" name="RS_dataUsage" value="0"/>
</XMLAttributes>
</dataItem>
<dataItem name="join" aggregate="none">
<expression>'a'</expression>
</dataItem>
</selection>
<detailFilters>
<detailFilter>
<filterExpression>[Date]<= 2010-02-28</filterExpression>
</detailFilter>
</detailFilters>
</query>
<query name="dimensions">
<source>
<joinOperation>
<joinOperands>
<joinOperand cardinality="1:1">
<queryRef refQuery="source"/>
</joinOperand>
<joinOperand cardinality="1:1">
<queryRef refQuery="date"/>
</joinOperand>
</joinOperands>
<joinFilter>
<filterExpression>[source].[join] = [date].[join]</filterExpression>
</joinFilter>
</joinOperation>
</source>
<selection>
<dataItem name="Date" aggregate="none" rollupAggregate="none">
<expression>[date].[Date]</expression>
</dataItem>
<dataItem name="Day of the week" aggregate="none" rollupAggregate="none">
<expression>[date].[Day of the week]</expression>
</dataItem>
<dataItem name="Order method type" aggregate="none" rollupAggregate="none">
<expression>[source].[Order method type]</expression>
</dataItem>
<dataItem name="Region" aggregate="none" rollupAggregate="none">
<expression>[source].[Region]</expression>
</dataItem>
</selection>
</query>
<query name="output">
<source>
<joinOperation>
<joinOperands>
<joinOperand cardinality="0:1">
<queryRef refQuery="source"/>
</joinOperand>
<joinOperand cardinality="1:1">
<queryRef refQuery="dimensions"/>
</joinOperand>
</joinOperands>
<joinFilter>
<filterExpression>[source].[Date] = [dimensions].[Date] and [source].[Order method type] = [dimensions].[Order method type] and [source].[Region] = [dimensions].[Region]</filterExpression>
</joinFilter>
</joinOperation>
</source>
<selection>
<dataItem name="Date" aggregate="none" rollupAggregate="none">
<expression>[dimensions].[Date]</expression>
<XMLAttributes>
<XMLAttribute name="RS_dataType" value="4" output="no"/>
<XMLAttribute name="RS_dataUsage" value="0" output="no"/>
</XMLAttributes>
</dataItem>
<dataItem name="Day of the week" aggregate="none" rollupAggregate="none">
<expression>[dimensions].[Day of the week]</expression>
</dataItem>
<dataItem name="Order method type" aggregate="none" rollupAggregate="none">
<expression>[dimensions].[Order method type]</expression>
<XMLAttributes>
<XMLAttribute name="RS_dataType" value="3" output="no"/>
<XMLAttribute name="RS_dataUsage" value="0" output="no"/>
</XMLAttributes>
</dataItem>
<dataItem name="Region" aggregate="none" rollupAggregate="none">
<expression>[dimensions].[Region]</expression>
</dataItem>
<dataItem name="Revenue" aggregate="total" rollupAggregate="automatic">
<expression>[source].[Revenue]</expression>
<XMLAttributes>
<XMLAttribute name="RS_dataType" value="2" output="no"/>
<XMLAttribute name="RS_dataUsage" value="2" output="no"/>
</XMLAttributes>
</dataItem>
</selection>
</query>
</queries>
<XMLAttributes>
<XMLAttribute output="no" name="RS_CreateExtendedDataItems" value="true"/>
<XMLAttribute output="no" name="listSeparator" value=","/>
<XMLAttribute output="no" name="decimalSeparator" value="."/>
<XMLAttribute output="no" name="RS_modelModificationTime" value="2015-11-25T21:38:24.820Z"/>
</XMLAttributes>
<modelPath type="FM">/content/folder[#name='Samples']/folder[#name='Models']/package[#name='GO sales (query)']/model[#name='model']</modelPath>
</report>
Using the legacy charts, you can use a conditional pallete on the measure. The following example uses the day_of_week field to apply it to the date. I used the properties property to ensure the day_of_week is included in the query given its not projected.
<report xmlns="http://developer.cognos.com/schemas/report/15.5/" expressionLocale="en" useStyleVersion="11.6">
<drillBehavior/>
<layouts>
<layout>
<reportPages>
<page name="Page1">
<style>
<defaultStyles>
<defaultStyle refStyle="pg"/>
</defaultStyles>
</style>
<pageBody>
<style>
<defaultStyles>
<defaultStyle refStyle="pb"/>
</defaultStyles>
</style>
<contents><v2_combinationChart maxHotspots="10000" name="Combination chart1" refQuery="Query1">
<v2_combinationTypeTooltips/>
<v2_legend>
<v2_legendPosition>
<v2_legendPreset/>
</v2_legendPosition>
<v2_legendTitle refQuery="Query1">
<v2_chartTextContents>
<v2_automaticText/>
</v2_chartTextContents>
<style>
<defaultStyles>
<defaultStyle refStyle="lx"/>
</defaultStyles>
</style>
</v2_legendTitle>
<style>
<defaultStyles>
<defaultStyle refStyle="lg"/>
</defaultStyles>
</style>
</v2_legend>
<v2_commonAxis>
<v2_ordinalAxis>
<v2_axisTitle refQuery="Query1">
<v2_chartTextContents>
<v2_automaticText/>
</v2_chartTextContents>
<style>
<defaultStyles>
<defaultStyle refStyle="at"/>
</defaultStyles>
</style>
</v2_axisTitle>
<v2_axisLine lineWeight="0"/>
<v2_axisLabels>
<style>
<defaultStyles>
<defaultStyle refStyle="al"/>
</defaultStyles>
</style>
</v2_axisLabels>
<v2_labelControl/></v2_ordinalAxis>
<chartNodes><chartNode><chartNodeMembers><chartNodeMember refDataItem="Date"><chartContents><chartTextItem><dataSource><memberCaption/></dataSource></chartTextItem></chartContents></chartNodeMember></chartNodeMembers></chartNode></chartNodes></v2_commonAxis>
<v2_topLeftAxis>
<v2_combinationChartTypes>
<v2_line>
<v2_linePalette markerSize="5pt">
<v2_linePaletteEntries><v2_linePaletteEntry>
<v2_lineFill defaultColor="#8599D3">
<v2_linearGradient>
<v2_gradientColor gradientColor="#8599D3"/>
<v2_gradientColor colorPosition="100" gradientColor="#5876AE"/>
</v2_linearGradient>
</v2_lineFill>
<v2_pointPaletteEntry>
<v2_fillEffect>
<v2_linearGradient>
<v2_gradientColor gradientColor="#8599D3"/>
<v2_gradientColor colorPosition="100" gradientColor="#5876AE"/>
</v2_linearGradient>
</v2_fillEffect>
</v2_pointPaletteEntry>
</v2_linePaletteEntry><v2_linePaletteEntry>
<v2_lineFill defaultColor="#E3AE6C">
<v2_linearGradient>
<v2_gradientColor gradientColor="#E3AE6C"/>
<v2_gradientColor colorPosition="100" gradientColor="#CD854E"/>
</v2_linearGradient>
</v2_lineFill>
<v2_pointPaletteEntry>
<v2_fillEffect>
<v2_linearGradient>
<v2_gradientColor gradientColor="#E3AE6C"/>
<v2_gradientColor colorPosition="100" gradientColor="#CD854E"/>
</v2_linearGradient>
</v2_fillEffect>
</v2_pointPaletteEntry>
</v2_linePaletteEntry><v2_linePaletteEntry>
<v2_lineFill defaultColor="#839862">
<v2_linearGradient>
<v2_gradientColor gradientColor="#839862"/>
<v2_gradientColor colorPosition="100" gradientColor="#6C7F56"/>
</v2_linearGradient>
</v2_lineFill>
<v2_pointPaletteEntry>
<v2_fillEffect>
<v2_linearGradient>
<v2_gradientColor gradientColor="#839862"/>
<v2_gradientColor colorPosition="100" gradientColor="#6C7F56"/>
</v2_linearGradient>
</v2_fillEffect>
</v2_pointPaletteEntry>
</v2_linePaletteEntry><v2_linePaletteEntry>
<v2_lineFill defaultColor="#B7C873">
<v2_linearGradient>
<v2_gradientColor gradientColor="#B7C873"/>
<v2_gradientColor colorPosition="100" gradientColor="#AFB885"/>
</v2_linearGradient>
</v2_lineFill>
<v2_pointPaletteEntry>
<v2_fillEffect>
<v2_linearGradient>
<v2_gradientColor gradientColor="#B7C873"/>
<v2_gradientColor colorPosition="100" gradientColor="#AFB885"/>
</v2_linearGradient>
</v2_fillEffect>
</v2_pointPaletteEntry>
</v2_linePaletteEntry><v2_linePaletteEntry>
<v2_lineFill defaultColor="#8484A8">
<v2_linearGradient>
<v2_gradientColor gradientColor="#8484A8"/>
<v2_gradientColor colorPosition="100" gradientColor="#525E7E"/>
</v2_linearGradient>
</v2_lineFill>
<v2_pointPaletteEntry>
<v2_fillEffect>
<v2_linearGradient>
<v2_gradientColor gradientColor="#8484A8"/>
<v2_gradientColor colorPosition="100" gradientColor="#525E7E"/>
</v2_linearGradient>
</v2_fillEffect>
</v2_pointPaletteEntry>
</v2_linePaletteEntry><v2_linePaletteEntry>
<v2_lineFill defaultColor="#C0CCED">
<v2_linearGradient>
<v2_gradientColor gradientColor="#C0CCED"/>
<v2_gradientColor colorPosition="100" gradientColor="#B0C2E5"/>
</v2_linearGradient>
</v2_lineFill>
<v2_pointPaletteEntry>
<v2_fillEffect>
<v2_linearGradient>
<v2_gradientColor gradientColor="#C0CCED"/>
<v2_gradientColor colorPosition="100" gradientColor="#B0C2E5"/>
</v2_linearGradient>
</v2_fillEffect>
</v2_pointPaletteEntry>
</v2_linePaletteEntry><v2_linePaletteEntry>
<v2_lineFill defaultColor="#8C5580">
<v2_linearGradient>
<v2_gradientColor gradientColor="#8C5580"/>
<v2_gradientColor colorPosition="100" gradientColor="#794067"/>
</v2_linearGradient>
</v2_lineFill>
<v2_pointPaletteEntry>
<v2_fillEffect>
<v2_linearGradient>
<v2_gradientColor gradientColor="#8C5580"/>
<v2_gradientColor colorPosition="100" gradientColor="#794067"/>
</v2_linearGradient>
</v2_fillEffect>
</v2_pointPaletteEntry>
</v2_linePaletteEntry><v2_linePaletteEntry>
<v2_lineFill defaultColor="#C789BC">
<v2_linearGradient>
<v2_gradientColor gradientColor="#C789BC"/>
<v2_gradientColor colorPosition="100" gradientColor="#BB72BC"/>
</v2_linearGradient>
</v2_lineFill>
<v2_pointPaletteEntry>
<v2_fillEffect>
<v2_linearGradient>
<v2_gradientColor gradientColor="#C789BC"/>
<v2_gradientColor colorPosition="100" gradientColor="#BB72BC"/>
</v2_linearGradient>
</v2_fillEffect>
</v2_pointPaletteEntry>
</v2_linePaletteEntry><v2_linePaletteEntry>
<v2_lineFill defaultColor="#D5BAEF">
<v2_linearGradient>
<v2_gradientColor gradientColor="#D5BAEF"/>
<v2_gradientColor colorPosition="100" gradientColor="#C29FD1"/>
</v2_linearGradient>
</v2_lineFill>
<v2_pointPaletteEntry>
<v2_fillEffect>
<v2_linearGradient>
<v2_gradientColor gradientColor="#D5BAEF"/>
<v2_gradientColor colorPosition="100" gradientColor="#C29FD1"/>
</v2_linearGradient>
</v2_fillEffect>
</v2_pointPaletteEntry>
</v2_linePaletteEntry><v2_linePaletteEntry>
<v2_lineFill defaultColor="#83683F">
<v2_linearGradient>
<v2_gradientColor gradientColor="#83683F"/>
<v2_gradientColor colorPosition="100" gradientColor="#604926"/>
</v2_linearGradient>
</v2_lineFill>
<v2_pointPaletteEntry>
<v2_fillEffect>
<v2_linearGradient>
<v2_gradientColor gradientColor="#83683F"/>
<v2_gradientColor colorPosition="100" gradientColor="#604926"/>
</v2_linearGradient>
</v2_fillEffect>
</v2_pointPaletteEntry>
</v2_linePaletteEntry><v2_linePaletteEntry>
<v2_lineFill defaultColor="#DCB05A">
<v2_linearGradient>
<v2_gradientColor gradientColor="#DCB05A"/>
<v2_gradientColor colorPosition="100" gradientColor="#C09C52"/>
</v2_linearGradient>
</v2_lineFill>
<v2_pointPaletteEntry>
<v2_fillEffect>
<v2_linearGradient>
<v2_gradientColor gradientColor="#DCB05A"/>
<v2_gradientColor colorPosition="100" gradientColor="#C09C52"/>
</v2_linearGradient>
</v2_fillEffect>
</v2_pointPaletteEntry>
</v2_linePaletteEntry><v2_linePaletteEntry>
<v2_lineFill defaultColor="#F4DF9E">
<v2_linearGradient>
<v2_gradientColor gradientColor="#F4DF9E"/>
<v2_gradientColor colorPosition="100" gradientColor="#E4CF87"/>
</v2_linearGradient>
</v2_lineFill>
<v2_pointPaletteEntry>
<v2_fillEffect>
<v2_linearGradient>
<v2_gradientColor gradientColor="#F4DF9E"/>
<v2_gradientColor colorPosition="100" gradientColor="#E4CF87"/>
</v2_linearGradient>
</v2_fillEffect>
</v2_pointPaletteEntry>
</v2_linePaletteEntry><v2_linePaletteEntry>
<v2_lineFill defaultColor="#5F8A8C">
<v2_linearGradient>
<v2_gradientColor gradientColor="#5F8A8C"/>
<v2_gradientColor colorPosition="100" gradientColor="#537579"/>
</v2_linearGradient>
</v2_lineFill>
<v2_pointPaletteEntry>
<v2_fillEffect>
<v2_linearGradient>
<v2_gradientColor gradientColor="#5F8A8C"/>
<v2_gradientColor colorPosition="100" gradientColor="#537579"/>
</v2_linearGradient>
</v2_fillEffect>
</v2_pointPaletteEntry>
</v2_linePaletteEntry><v2_linePaletteEntry>
<v2_lineFill defaultColor="#96C4B2">
<v2_linearGradient>
<v2_gradientColor gradientColor="#96C4B2"/>
<v2_gradientColor colorPosition="100" gradientColor="#89B0A0"/>
</v2_linearGradient>
</v2_lineFill>
<v2_pointPaletteEntry>
<v2_fillEffect>
<v2_linearGradient>
<v2_gradientColor gradientColor="#96C4B2"/>
<v2_gradientColor colorPosition="100" gradientColor="#89B0A0"/>
</v2_linearGradient>
</v2_fillEffect>
</v2_pointPaletteEntry>
</v2_linePaletteEntry><v2_linePaletteEntry>
<v2_lineFill defaultColor="#CBE8E7">
<v2_linearGradient>
<v2_gradientColor gradientColor="#CBE8E7"/>
<v2_gradientColor colorPosition="100" gradientColor="#BDD6D5"/>
</v2_linearGradient>
</v2_lineFill>
<v2_pointPaletteEntry>
<v2_fillEffect>
<v2_linearGradient>
<v2_gradientColor gradientColor="#CBE8E7"/>
<v2_gradientColor colorPosition="100" gradientColor="#BDD6D5"/>
</v2_linearGradient>
</v2_fillEffect>
</v2_pointPaletteEntry>
</v2_linePaletteEntry><v2_linePaletteEntry>
<v2_lineFill defaultColor="#AE6564">
<v2_linearGradient>
<v2_gradientColor gradientColor="#AE6564"/>
<v2_gradientColor colorPosition="100" gradientColor="#875352"/>
</v2_linearGradient>
</v2_lineFill>
<v2_pointPaletteEntry>
<v2_fillEffect>
<v2_linearGradient>
<v2_gradientColor gradientColor="#AE6564"/>
<v2_gradientColor colorPosition="100" gradientColor="#875352"/>
</v2_linearGradient>
</v2_fillEffect>
</v2_pointPaletteEntry>
</v2_linePaletteEntry><v2_linePaletteEntry>
<v2_lineFill defaultColor="#D88C6F">
<v2_linearGradient>
<v2_gradientColor gradientColor="#D88C6F"/>
<v2_gradientColor colorPosition="100" gradientColor="#C47D61"/>
</v2_linearGradient>
</v2_lineFill>
<v2_pointPaletteEntry>
<v2_fillEffect>
<v2_linearGradient>
<v2_gradientColor gradientColor="#D88C6F"/>
<v2_gradientColor colorPosition="100" gradientColor="#C47D61"/>
</v2_linearGradient>
</v2_fillEffect>
</v2_pointPaletteEntry>
</v2_linePaletteEntry><v2_linePaletteEntry>
<v2_lineFill defaultColor="#E3C9B0">
<v2_linearGradient>
<v2_gradientColor gradientColor="#E3C9B0"/>
<v2_gradientColor colorPosition="100" gradientColor="#D2B2A5"/>
</v2_linearGradient>
</v2_lineFill>
<v2_pointPaletteEntry>
<v2_fillEffect>
<v2_linearGradient>
<v2_gradientColor gradientColor="#E3C9B0"/>
<v2_gradientColor colorPosition="100" gradientColor="#D2B2A5"/>
</v2_linearGradient>
</v2_fillEffect>
</v2_pointPaletteEntry>
</v2_linePaletteEntry><v2_linePaletteEntry>
<v2_lineFill defaultColor="#848484">
<v2_linearGradient>
<v2_gradientColor gradientColor="#848484"/>
<v2_gradientColor colorPosition="100" gradientColor="#555555"/>
</v2_linearGradient>
</v2_lineFill>
<v2_pointPaletteEntry>
<v2_fillEffect>
<v2_linearGradient>
<v2_gradientColor gradientColor="#848484"/>
<v2_gradientColor colorPosition="100" gradientColor="#555555"/>
</v2_linearGradient>
</v2_fillEffect>
</v2_pointPaletteEntry>
</v2_linePaletteEntry><v2_linePaletteEntry>
<v2_lineFill defaultColor="#a4a4a4">
<v2_linearGradient>
<v2_gradientColor gradientColor="#a4a4a4"/>
<v2_gradientColor colorPosition="100" gradientColor="#909090"/>
</v2_linearGradient>
</v2_lineFill>
<v2_pointPaletteEntry>
<v2_fillEffect>
<v2_linearGradient>
<v2_gradientColor gradientColor="#a4a4a4"/>
<v2_gradientColor colorPosition="100" gradientColor="#909090"/>
</v2_linearGradient>
</v2_fillEffect>
</v2_pointPaletteEntry>
</v2_linePaletteEntry><v2_linePaletteEntry>
<v2_lineFill defaultColor="#C7C7C7">
<v2_linearGradient>
<v2_gradientColor gradientColor="#C7C7C7"/>
<v2_gradientColor colorPosition="100" gradientColor="#c1c1c1"/>
</v2_linearGradient>
</v2_lineFill>
<v2_pointPaletteEntry>
<v2_fillEffect>
<v2_linearGradient>
<v2_gradientColor gradientColor="#C7C7C7"/>
<v2_gradientColor colorPosition="100" gradientColor="#c1c1c1"/>
</v2_linearGradient>
</v2_fillEffect>
</v2_pointPaletteEntry>
</v2_linePaletteEntry></v2_linePaletteEntries></v2_linePalette>
<v2_conditionalLinePalette showInLegend="hide"><v2_lineAdvancedCondition><v2_lineCases><v2_lineCase><v2_conditionalPaletteEntryLabel><v2_automaticLabel/></v2_conditionalPaletteEntryLabel><reportCondition>_day_of_week ([Query1].[Date],1) in (6,7) and [Query1].[Order method type]='E-mail'</reportCondition><v2_linePaletteEntry lineStyle="dash"><v2_lineFill defaultColor="#198545"><v2_color color="#8599D3"/></v2_lineFill><v2_pointPaletteEntry><v2_fillEffect defaultColor="#198545"><v2_solidColor color="#198545"/></v2_fillEffect></v2_pointPaletteEntry></v2_linePaletteEntry></v2_lineCase></v2_lineCases></v2_lineAdvancedCondition><v2_lineAdvancedCondition><v2_lineCases><v2_lineCase><reportCondition>_day_of_week ([Query1].[Date],1) in (6,7) and [Query1].[Order method type]='Telephone'</reportCondition><v2_linePaletteEntry lineStyle="dash"><v2_lineFill defaultColor="#198545"><v2_color color="#E3AE6C"/></v2_lineFill><v2_pointPaletteEntry><v2_fillEffect defaultColor="#198545"><v2_solidColor color="#198545"/></v2_fillEffect></v2_pointPaletteEntry></v2_linePaletteEntry></v2_lineCase></v2_lineCases></v2_lineAdvancedCondition></v2_conditionalLinePalette><chartNodes><chartNode><chartNodeMembers><chartNodeMember refDataItem="Order method type"><chartContents><chartTextItem><dataSource><memberCaption/></dataSource></chartTextItem></chartContents></chartNodeMember></chartNodeMembers></chartNode></chartNodes></v2_line>
</v2_combinationChartTypes>
<v2_axis>
<v2_axisTitle refQuery="Query1">
<v2_chartTextContents>
<v2_automaticText/>
</v2_chartTextContents>
<style>
<defaultStyles>
<defaultStyle refStyle="at"/>
</defaultStyles>
</style>
</v2_axisTitle>
<v2_axisLine lineWeight="0"/>
<v2_axisRange>
<v2_automaticRange/>
</v2_axisRange>
<v2_axisLabels>
<style>
<defaultStyles>
<defaultStyle refStyle="al"/>
</defaultStyles>
</style>
</v2_axisLabels>
<v2_majorGridlines lineWeight="0" lineColor="#CCCCCC"/>
</v2_axis>
</v2_topLeftAxis>
<style>
<defaultStyles>
<defaultStyle refStyle="ch"/>
</defaultStyles>
<CSS value="width:5000px"/></style>
<noDataHandler>
<contents>
<block>
<contents>
<textItem>
<dataSource>
<staticValue>No Data Available</staticValue>
</dataSource>
</textItem>
</contents>
<style>
<CSS value="padding:16px;"/>
</style>
</block>
</contents>
</noDataHandler>
<v2_defaultChartMeasure refDataItem="Revenue"/></v2_combinationChart></contents>
</pageBody>
</page>
</reportPages>
</layout>
</layouts>
<queries><query name="Query1"><source><model/></source><selection><dataItem aggregate="total" name="Revenue"><expression>[Sales (query)].[Sales].[Revenue]</expression><XMLAttributes><XMLAttribute output="no" name="RS_dataType" value="2"/><XMLAttribute output="no" name="RS_dataUsage" value="2"/><XMLAttribute output="no" name="RS_isCurrency" value="true"/></XMLAttributes></dataItem><dataItem aggregate="none" rollupAggregate="none" name="Date"><expression>[Sales (query)].[Time].[Date]</expression><XMLAttributes><XMLAttribute output="no" name="RS_dataType" value="4"/><XMLAttribute output="no" name="RS_dataUsage" value="0"/></XMLAttributes></dataItem><dataItem aggregate="none" rollupAggregate="none" name="Day of the week"><expression>[Sales (query)].[Time].[Day of the week]</expression><XMLAttributes><XMLAttribute output="no" name="RS_dataType" value="1"/><XMLAttribute output="no" name="RS_dataUsage" value="0"/></XMLAttributes></dataItem><dataItem aggregate="none" rollupAggregate="none" name="Order method type"><expression>[Sales (query)].[Order method].[Order method type]</expression><XMLAttributes><XMLAttribute output="no" name="RS_dataType" value="3"/><XMLAttribute output="no" name="RS_dataUsage" value="0"/></XMLAttributes></dataItem></selection><detailFilters><detailFilter><filterExpression>[Order method type] in ('E-mail','Telephone')</filterExpression></detailFilter><detailFilter><filterExpression>[Date]<= 2010-02-28</filterExpression></detailFilter></detailFilters></query></queries><XMLAttributes><XMLAttribute output="no" name="RS_CreateExtendedDataItems" value="true"/><XMLAttribute output="no" name="listSeparator" value=","/><XMLAttribute output="no" name="decimalSeparator" value="."/><XMLAttribute output="no" name="RS_modelModificationTime" value="2013-01-08T15:32:22.123Z"/></XMLAttributes><modelPath>/content/folder[#name='Samples_LG_DQ']/folder[#name='Models']/package[#name='GO Sales (query)']/model[#name='model']</modelPath></report>
Related
I have been working around to change pivot header background the same as Photo Application in Windows 10. However, it only changes the background of text (header), what I want is to change whole background.
<DataTemplate x:Name="PivotHeaderTemplate">
<StackPanel Background="Red">
<TextBlock Text="{Binding Header}" Style="{StaticResource SubtitleTextBlockStyle}"/>
</StackPanel>
</DataTemplate>
How to change the background of pivot header?
Thanks!
I find Responsive Pivot Headers in Universal Windows Platform apps as solution for my problem.
You can edit default Pivot style:
<x:Double x:Key="PivotTitleFontSize">15</x:Double>
<FontWeight x:Key="PivotTitleThemeFontWeight">Bold</FontWeight>
<Thickness x:Key="PivotLandscapeThemePadding">12,14,0,13</Thickness>
<Thickness x:Key="PivotNavButtonBorderThemeThickness">0</Thickness>
<Thickness x:Key="PivotNavButtonMargin">0,6,0,0</Thickness>
<Thickness x:Key="PivotPortraitThemePadding">12,14,0,13</Thickness>
<SolidColorBrush x:Key="PivotHeaderBackground">Red</SolidColorBrush>
<Style TargetType="Pivot">
<Setter Property="Margin"
Value="0" />
<Setter Property="Padding"
Value="0" />
<Setter Property="Background"
Value="Transparent" />
<Setter Property="IsTabStop"
Value="False" />
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<Grid />
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Pivot">
<Grid x:Name="RootElement"
Background="{TemplateBinding Background}"
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
VerticalAlignment="{TemplateBinding VerticalAlignment}">
<Grid.Resources>
<Style x:Key="BaseContentControlStyle"
TargetType="ContentControl">
<Setter Property="FontFamily"
Value="XamlAutoFontFamily" />
<Setter Property="FontWeight"
Value="SemiBold" />
<Setter Property="FontSize"
Value="15" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ContentControl">
<ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}"
ContentTransitions="{TemplateBinding ContentTransitions}"
Content="{TemplateBinding Content}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{TemplateBinding Padding}"
OpticalMarginAlignment="TrimSideBearings"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="TitleContentControlStyle"
BasedOn="{StaticResource BaseContentControlStyle}"
TargetType="ContentControl">
<Setter Property="FontFamily"
Value="{ThemeResource PivotTitleFontFamily}" />
<Setter Property="FontWeight"
Value="{ThemeResource PivotTitleThemeFontWeight}" />
<Setter Property="FontSize"
Value="{ThemeResource PivotTitleFontSize}" />
</Style>
</Grid.Resources>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="Orientation">
<VisualState x:Name="Portrait">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Margin"
Storyboard.TargetName="TitleContentControl">
<DiscreteObjectKeyFrame KeyTime="0"
Value="{ThemeResource PivotPortraitThemePadding}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Landscape">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Margin"
Storyboard.TargetName="TitleContentControl">
<DiscreteObjectKeyFrame KeyTime="0"
Value="{ThemeResource PivotLandscapeThemePadding}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="NavigationButtonsVisibility">
<VisualState x:Name="NavigationButtonsHidden" />
<VisualState x:Name="NavigationButtonsVisible">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
Storyboard.TargetName="NextButton">
<DiscreteObjectKeyFrame KeyTime="0"
Value="1" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsEnabled"
Storyboard.TargetName="NextButton">
<DiscreteObjectKeyFrame KeyTime="0"
Value="True" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
Storyboard.TargetName="PreviousButton">
<DiscreteObjectKeyFrame KeyTime="0"
Value="1" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsEnabled"
Storyboard.TargetName="PreviousButton">
<DiscreteObjectKeyFrame KeyTime="0"
Value="True" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="HeaderStates">
<VisualState x:Name="HeaderDynamic" />
<VisualState x:Name="HeaderStatic">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
Storyboard.TargetName="Header">
<DiscreteObjectKeyFrame KeyTime="0"
Value="Collapsed" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
Storyboard.TargetName="StaticHeader">
<DiscreteObjectKeyFrame KeyTime="0"
Value="Visible" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<ContentControl x:Name="TitleContentControl"
ContentTemplate="{TemplateBinding TitleTemplate}"
Content="{TemplateBinding Title}"
IsTabStop="False"
Margin="{StaticResource PivotPortraitThemePadding}"
Style="{StaticResource TitleContentControlStyle}"
Visibility="Collapsed" />
<Grid Grid.Row="1">
<Grid.Resources>
<ControlTemplate x:Key="NextTemplate"
TargetType="Button">
<Border x:Name="Root"
BorderBrush="{ThemeResource SystemControlForegroundTransparentBrush}"
BorderThickness="{ThemeResource PivotNavButtonBorderThemeThickness}"
Background="{ThemeResource SystemControlBackgroundBaseMediumLowBrush}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="PointerOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background"
Storyboard.TargetName="Root">
<DiscreteObjectKeyFrame KeyTime="0"
Value="{ThemeResource SystemControlHighlightBaseMediumBrush}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground"
Storyboard.TargetName="Arrow">
<DiscreteObjectKeyFrame KeyTime="0"
Value="{ThemeResource SystemControlHighlightAltAltMediumHighBrush}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background"
Storyboard.TargetName="Root">
<DiscreteObjectKeyFrame KeyTime="0"
Value="{ThemeResource SystemControlHighlightBaseMediumHighBrush}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground"
Storyboard.TargetName="Arrow">
<DiscreteObjectKeyFrame KeyTime="0"
Value="{ThemeResource SystemControlHighlightAltAltMediumHighBrush}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<FontIcon x:Name="Arrow"
Foreground="{ThemeResource SystemControlForegroundAltMediumHighBrush}"
FontSize="12"
FontFamily="{ThemeResource SymbolThemeFontFamily}"
Glyph=""
HorizontalAlignment="Center"
MirroredWhenRightToLeft="True"
UseLayoutRounding="False"
VerticalAlignment="Center" />
</Border>
</ControlTemplate>
<ControlTemplate x:Key="PreviousTemplate"
TargetType="Button">
<Border x:Name="Root"
BorderBrush="{ThemeResource SystemControlForegroundTransparentBrush}"
BorderThickness="{ThemeResource PivotNavButtonBorderThemeThickness}"
Background="{ThemeResource SystemControlBackgroundBaseMediumLowBrush}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="PointerOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background"
Storyboard.TargetName="Root">
<DiscreteObjectKeyFrame KeyTime="0"
Value="{ThemeResource SystemControlHighlightBaseMediumBrush}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground"
Storyboard.TargetName="Arrow">
<DiscreteObjectKeyFrame KeyTime="0"
Value="{ThemeResource SystemControlHighlightAltAltMediumHighBrush}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background"
Storyboard.TargetName="Root">
<DiscreteObjectKeyFrame KeyTime="0"
Value="{ThemeResource SystemControlHighlightBaseMediumHighBrush}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground"
Storyboard.TargetName="Arrow">
<DiscreteObjectKeyFrame KeyTime="0"
Value="{ThemeResource SystemControlHighlightAltAltMediumHighBrush}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<FontIcon x:Name="Arrow"
Foreground="{ThemeResource SystemControlForegroundAltMediumHighBrush}"
FontSize="12"
FontFamily="{ThemeResource SymbolThemeFontFamily}"
Glyph=""
HorizontalAlignment="Center"
MirroredWhenRightToLeft="True"
UseLayoutRounding="False"
VerticalAlignment="Center" />
</Border>
</ControlTemplate>
</Grid.Resources>
<ScrollViewer x:Name="ScrollViewer"
BringIntoViewOnFocusChange="False"
HorizontalSnapPointsAlignment="Center"
HorizontalSnapPointsType="MandatorySingle"
HorizontalScrollBarVisibility="Hidden"
Margin="{TemplateBinding Padding}"
Template="{StaticResource ScrollViewerScrollBarlessTemplate}"
VerticalSnapPointsType="None"
VerticalScrollBarVisibility="Disabled"
VerticalScrollMode="Disabled"
VerticalContentAlignment="Stretch"
ZoomMode="Disabled">
<PivotPanel x:Name="Panel"
VerticalAlignment="Stretch">
<Grid x:Name="PivotLayoutElement">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.RenderTransform>
<CompositeTransform x:Name="PivotLayoutElementTranslateTransform" />
</Grid.RenderTransform>
<ContentPresenter x:Name="LeftHeaderPresenter"
ContentTemplate="{TemplateBinding LeftHeaderTemplate}"
Content="{TemplateBinding LeftHeader}"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" />
<ContentControl x:Name="HeaderClipper"
Grid.Column="1"
HorizontalContentAlignment="Stretch"
UseSystemFocusVisuals="True">
<ContentControl.Clip>
<RectangleGeometry x:Name="HeaderClipperGeometry" />
</ContentControl.Clip>
<Grid Background="{StaticResource PivotHeaderBackground}">
<PivotHeaderPanel x:Name="StaticHeader"
Visibility="Collapsed" />
<PivotHeaderPanel x:Name="Header">
<PivotHeaderPanel.RenderTransform>
<TransformGroup>
<CompositeTransform x:Name="HeaderTranslateTransform" />
<CompositeTransform x:Name="HeaderOffsetTranslateTransform" />
</TransformGroup>
</PivotHeaderPanel.RenderTransform>
</PivotHeaderPanel>
</Grid>
</ContentControl>
<Button x:Name="PreviousButton"
Background="Transparent"
Grid.Column="1"
HorizontalAlignment="Left"
Height="36"
IsTabStop="False"
IsEnabled="False"
Margin="{ThemeResource PivotNavButtonMargin}"
Opacity="0"
Template="{StaticResource PreviousTemplate}"
UseSystemFocusVisuals="False"
VerticalAlignment="Top"
Width="20" />
<Button x:Name="NextButton"
Background="Transparent"
Grid.Column="1"
HorizontalAlignment="Right"
Height="36"
IsTabStop="False"
IsEnabled="False"
Margin="{ThemeResource PivotNavButtonMargin}"
Opacity="0"
Template="{StaticResource NextTemplate}"
UseSystemFocusVisuals="False"
VerticalAlignment="Top"
Width="20" />
<ContentPresenter x:Name="RightHeaderPresenter"
ContentTemplate="{TemplateBinding RightHeaderTemplate}"
Content="{TemplateBinding RightHeader}"
Grid.Column="2"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" />
<ItemsPresenter x:Name="PivotItemPresenter"
Grid.ColumnSpan="3"
Grid.Row="1">
<ItemsPresenter.RenderTransform>
<TransformGroup>
<TranslateTransform x:Name="ItemsPresenterTranslateTransform" />
<CompositeTransform x:Name="ItemsPresenterCompositeTransform" />
</TransformGroup>
</ItemsPresenter.RenderTransform>
</ItemsPresenter>
</Grid>
</PivotPanel>
</ScrollViewer>
</Grid>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
Source: https://msdn.microsoft.com/en-us/library/windows/apps/mt299144.aspx
I have TextBox once I make it to IsEnable=false my TextBox is not visible so how I do style to make it as it is I have removed Disable state from style but still same problem.
my style is here.
<Style x:Key="TextBoxStyle1" TargetType="TextBox">
<Setter Property="MinWidth" Value="{ThemeResource TextControlThemeMinWidth}"/>
<Setter Property="MinHeight" Value="{ThemeResource TextControlThemeMinHeight}"/>
<Setter Property="Foreground" Value="{ThemeResource TextBoxForegroundThemeBrush}"/>
<Setter Property="Background" Value="{ThemeResource TextBoxBackgroundThemeBrush}"/>
<Setter Property="BorderBrush" Value="{ThemeResource TextBoxBorderThemeBrush}"/>
<Setter Property="SelectionHighlightColor" Value="{ThemeResource TextSelectionHighlightColorThemeBrush}"/>
<Setter Property="BorderThickness" Value="{ThemeResource TextControlBorderThemeThickness}"/>
<Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}"/>
<Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}"/>
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden"/>
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Hidden"/>
<Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="False"/>
<Setter Property="Padding" Value="{ThemeResource TextControlThemePadding}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TextBox">
<Grid>
<Grid.Resources>
<Style x:Name="DeleteButtonStyle" TargetType="Button">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="PointerOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="BackgroundElement">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextBoxButtonPointerOverBackgroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="BorderElement">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextBoxButtonPointerOverBorderThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="GlyphElement">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextBoxButtonPointerOverForegroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="BackgroundElement">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextBoxButtonPressedBackgroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="BorderElement">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextBoxButtonPressedBorderThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="GlyphElement">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextBoxButtonPressedForegroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Border x:Name="BorderElement" BorderBrush="{ThemeResource TextBoxButtonBorderThemeBrush}" BorderThickness="{TemplateBinding BorderThickness}"/>
<Border x:Name="BackgroundElement" Background="{ThemeResource TextBoxButtonBackgroundThemeBrush}" Margin="{TemplateBinding BorderThickness}">
<TextBlock x:Name="GlyphElement" AutomationProperties.AccessibilityView="Raw" Foreground="{ThemeResource TextBoxButtonForegroundThemeBrush}" FontStyle="Normal" FontFamily="{ThemeResource SymbolThemeFontFamily}" HorizontalAlignment="Center" Text="" VerticalAlignment="Center"/>
</Border>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Grid.Resources>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Disabled">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="BackgroundElement">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextBoxDisabledBackgroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="BorderElement">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextBoxDisabledBorderThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentElement">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextBoxDisabledForegroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="PlaceholderTextContentPresenter">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextBoxDisabledForegroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Normal">
<Storyboard>
<DoubleAnimation Duration="0" To="{ThemeResource TextControlBackgroundThemeOpacity}" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundElement"/>
<DoubleAnimation Duration="0" To="{ThemeResource TextControlBorderThemeOpacity}" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BorderElement"/>
</Storyboard>
</VisualState>
<VisualState x:Name="PointerOver">
<Storyboard>
<DoubleAnimation Duration="0" To="{ThemeResource TextControlPointerOverBackgroundThemeOpacity}" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundElement"/>
<DoubleAnimation Duration="0" To="{ThemeResource TextControlPointerOverBorderThemeOpacity}" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BorderElement"/>
</Storyboard>
</VisualState>
<VisualState x:Name="Focused"/>
</VisualStateGroup>
<VisualStateGroup x:Name="ButtonStates">
<VisualState x:Name="ButtonVisible">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="DeleteButton">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<Visibility>Visible</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="ButtonCollapsed"/>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Border x:Name="BackgroundElement" Background="{TemplateBinding Background}" Grid.ColumnSpan="2" Margin="{TemplateBinding BorderThickness}" Grid.Row="1" Grid.RowSpan="1"/>
<Border x:Name="BorderElement" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="2" Grid.Row="1" Grid.RowSpan="1"/>
<ContentPresenter x:Name="HeaderContentPresenter" Grid.ColumnSpan="2" ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}" Foreground="{ThemeResource TextBoxForegroundHeaderThemeBrush}" FontWeight="Semilight" Margin="0,4,0,4" Grid.Row="0"/>
<ScrollViewer x:Name="ContentElement" AutomationProperties.AccessibilityView="Raw" HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" IsTabStop="False" IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}" IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}" IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}" Margin="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}" Grid.Row="1" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}" ZoomMode="Disabled"/>
<ContentControl x:Name="PlaceholderTextContentPresenter" Grid.ColumnSpan="2" Content="{TemplateBinding PlaceholderText}" Foreground="{ThemeResource TextBoxPlaceholderTextThemeBrush}" IsHitTestVisible="False" IsTabStop="False" Margin="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}" Grid.Row="1"/>
<Button x:Name="DeleteButton" BorderThickness="{TemplateBinding BorderThickness}" Grid.Column="1" FontSize="{TemplateBinding FontSize}" IsTabStop="False" Grid.Row="1" Style="{StaticResource DeleteButtonStyle}" Visibility="Collapsed" VerticalAlignment="Stretch"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
check attach Image when I am making it to IsEnable=false.
How do I make it as a normal.
I'm trying to combine two components(ListView and FlipView) in an windows store app , but I have a problem when click on the flipview next button becouse I want to listview just scroll items and don't select them.
How can i do that?
I find some examples and modify them and now this is the only problem that I have.
Thx.
Here is my code:
<Page
x:Class="FlipViewPreviewIndicator.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:FlipViewPreviewIndicator"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Page.Resources>
<Style x:Key="FlipViewStyle" TargetType="FlipView">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="TabNavigation" Value="Once"/>
<Setter Property="IsTabStop" Value="False"/>
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden"/>
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Hidden"/>
<Setter Property="ScrollViewer.IsHorizontalRailEnabled" Value="False"/>
<Setter Property="ScrollViewer.IsVerticalRailEnabled" Value="False"/>
<Setter Property="ScrollViewer.IsHorizontalScrollChainingEnabled" Value="True"/>
<Setter Property="ScrollViewer.IsVerticalScrollChainingEnabled" Value="True"/>
<Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="False"/>
<Setter Property="ScrollViewer.BringIntoViewOnFocusChange" Value="True"/>
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<VirtualizingStackPanel AreScrollSnapPointsRegular="True" Orientation="Horizontal"/>
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="FlipView">
<Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="FocusStates">
<VisualState x:Name="Focused">
<Storyboard>
<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="FocusVisualWhite"/>
<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="FocusVisualBlack"/>
</Storyboard>
</VisualState>
<VisualState x:Name="Unfocused"/>
<VisualState x:Name="PointerFocused"/>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Margin="3">
<Border.Resources>
<ControlTemplate x:Key="HorizontalNextTemplate" TargetType="Button">
<Border x:Name="Root" BorderBrush="{StaticResource FlipViewButtonBorderThemeBrush}" BorderThickness="{StaticResource FlipViewButtonBorderThemeThickness}" Background="{StaticResource FlipViewButtonBackgroundThemeBrush}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="PointerOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="Root">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource FlipViewButtonPointerOverBackgroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="Root">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource FlipViewButtonPointerOverBorderThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="Arrow">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource FlipViewButtonPointerOverForegroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="Root">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource FlipViewButtonPressedBackgroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="Root">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource FlipViewButtonPressedBorderThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="Arrow">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource FlipViewButtonPressedForegroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Path x:Name="Arrow" Data="M4.12,0 L9.67,5.47 L4.12,10.94 L0,10.88 L5.56,5.47 L0,0.06 z" Fill="{StaticResource FlipViewButtonForegroundThemeBrush}" HorizontalAlignment="Center" Height="10.94" Stretch="Fill" UseLayoutRounding="False" VerticalAlignment="Center" Width="9.67"/>
</Border>
</ControlTemplate>
<ControlTemplate x:Key="HorizontalPreviousTemplate" TargetType="Button">
<Border x:Name="Root" BorderBrush="{StaticResource FlipViewButtonBorderThemeBrush}" BorderThickness="{StaticResource FlipViewButtonBorderThemeThickness}" Background="{StaticResource FlipViewButtonBackgroundThemeBrush}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="PointerOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="Root">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource FlipViewButtonPointerOverBackgroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="Root">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource FlipViewButtonPointerOverBorderThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="Arrow">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource FlipViewButtonPointerOverForegroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="Root">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource FlipViewButtonPressedBackgroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="Root">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource FlipViewButtonPressedBorderThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="Arrow">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource FlipViewButtonPressedForegroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Path x:Name="Arrow" Data="M5.55,0 L9.67,0.06 L4.12,5.47 L9.67,10.88 L5.55,10.94 L0,5.48 z" Fill="{StaticResource FlipViewButtonForegroundThemeBrush}" HorizontalAlignment="Center" Height="10.94" Stretch="Fill" UseLayoutRounding="False" VerticalAlignment="Center" Width="9.67"/>
</Border>
</ControlTemplate>
<ControlTemplate x:Key="VerticalNextTemplate" TargetType="Button">
<Border x:Name="Root" BorderBrush="{StaticResource FlipViewButtonBorderThemeBrush}" BorderThickness="{StaticResource FlipViewButtonBorderThemeThickness}" Background="{StaticResource FlipViewButtonBackgroundThemeBrush}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="PointerOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="Root">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource FlipViewButtonPointerOverBackgroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="Root">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource FlipViewButtonPointerOverBorderThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="Arrow">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource FlipViewButtonPointerOverForegroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="Root">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource FlipViewButtonPressedBackgroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="Root">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource FlipViewButtonPressedBorderThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="Arrow">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource FlipViewButtonPressedForegroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Path x:Name="Arrow" Data="M0.06,0 L5.47,5.56 L10.88,0 L10.94,4.12 L5.48,9.67 L0,4.12 z" Fill="{StaticResource FlipViewButtonForegroundThemeBrush}" HorizontalAlignment="Center" Height="9.67" Stretch="Fill" UseLayoutRounding="False" VerticalAlignment="Center" Width="10.94"/>
</Border>
</ControlTemplate>
<ControlTemplate x:Key="VerticalPreviousTemplate" TargetType="Button">
<Border x:Name="Root" BorderBrush="{StaticResource FlipViewButtonBorderThemeBrush}" BorderThickness="{StaticResource FlipViewButtonBorderThemeThickness}" Background="{StaticResource FlipViewButtonBackgroundThemeBrush}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="PointerOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="Root">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource FlipViewButtonPointerOverBackgroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="Root">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource FlipViewButtonPointerOverBorderThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="Arrow">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource FlipViewButtonPointerOverForegroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="Root">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource FlipViewButtonPressedBackgroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="Root">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource FlipViewButtonPressedBorderThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="Arrow">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource FlipViewButtonPressedForegroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Path x:Name="Arrow" Data="M5.63,0 L11.11,5.55 L11.05,9.67 L5.64,4.12 L0.23,9.67 L0.17,5.55 z" Fill="{StaticResource FlipViewButtonForegroundThemeBrush}" HorizontalAlignment="Center" Height="9.67" Stretch="Fill" UseLayoutRounding="False" VerticalAlignment="Center" Width="10.94"/>
</Border>
</ControlTemplate>
</Border.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="209"/>
</Grid.RowDefinitions>
<ScrollViewer x:Name="ScrollingHost" BringIntoViewOnFocusChange="{TemplateBinding ScrollViewer.BringIntoViewOnFocusChange}" HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}" HorizontalSnapPointsType="MandatorySingle" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" IsTabStop="False" IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}" IsHorizontalScrollChainingEnabled="{TemplateBinding ScrollViewer.IsHorizontalScrollChainingEnabled}" IsVerticalScrollChainingEnabled="{TemplateBinding ScrollViewer.IsVerticalScrollChainingEnabled}" IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}" IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}" Padding="{TemplateBinding Padding}" TabNavigation="{TemplateBinding TabNavigation}" VerticalSnapPointsType="MandatorySingle" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}" ZoomMode="Disabled">
<ScrollViewer.ContentTransitions>
<TransitionCollection>
<RepositionThemeTransition/>
</TransitionCollection>
</ScrollViewer.ContentTransitions>
<ItemsPresenter Visibility="Collapsed"/>
</ScrollViewer>
<Button x:Name="PreviousButtonHorizontal" HorizontalAlignment="Left" Height="40" IsTabStop="False" Template="{StaticResource HorizontalPreviousTemplate}" VerticalAlignment="Center" Width="70"/>
<Button x:Name="NextButtonHorizontal" HorizontalAlignment="Right" Height="40" IsTabStop="False" Template="{StaticResource HorizontalNextTemplate}" VerticalAlignment="Center" Width="70"/>
<Button x:Name="PreviousButtonVertical" HorizontalAlignment="Center" Height="40" IsTabStop="False" Template="{StaticResource VerticalPreviousTemplate}" VerticalAlignment="Top" Width="70"/>
<Button x:Name="NextButtonVertical" HorizontalAlignment="Center" Height="40" IsTabStop="False" Template="{StaticResource VerticalNextTemplate}" VerticalAlignment="Bottom" Width="70"/>
<ListView
ItemsSource="{TemplateBinding ItemsSource}"
SelectedItem="{Binding SelectedItem, Mode=TwoWay, RelativeSource={RelativeSource Mode=TemplatedParent}}"
Padding="0,0,0,40"
ScrollViewer.HorizontalScrollBarVisibility="Auto"
ScrollViewer.VerticalScrollBarVisibility="Disabled"
ScrollViewer.HorizontalScrollMode="Enabled"
ScrollViewer.VerticalScrollMode="Disabled"
SelectionChanged="ListViewSelectionChanged1" Margin="75,0">
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" Margin="0,0,0,1" ScrollViewer.HorizontalScrollBarVisibility="Visible" ScrollViewer.VerticalScrollBarVisibility="Disabled" />
</ItemsPanelTemplate>
</ListView.ItemsPanel>
<ListView.ItemTemplate>
<DataTemplate>
<Grid HorizontalAlignment="Center" VerticalAlignment="Center">
<Image Source="{Binding ImageUri}" Stretch="UniformToFill"/>
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</Grid>
</Border>
<Rectangle x:Name="FocusVisualWhite" IsHitTestVisible="False" Opacity="0" StrokeDashOffset="1.5" StrokeEndLineCap="Square" Stroke="{StaticResource FocusVisualWhiteStrokeThemeBrush}" StrokeDashArray="1,1"/>
<Rectangle x:Name="FocusVisualBlack" IsHitTestVisible="False" Opacity="0" StrokeDashOffset="0.5" StrokeEndLineCap="Square" Stroke="{StaticResource FocusVisualBlackStrokeThemeBrush}" StrokeDashArray="1,1"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Page.Resources>
<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid/>
<FlipView Grid.Row="1" d:DataContext="{Binding Source={d:DesignInstance Type=local:SampleData, IsDesignTimeCreatable=True}}" ItemsSource="{Binding SampleItems}" Style="{StaticResource FlipViewStyle}" >
</FlipView>
</Grid>
I need help to change my progressBar's style at runtime (Windows Phone).
Any example?
Is that possbile?
Thanks!
Style on XAML:
<phone:PhoneApplicationPage.Resources>
<ControlTemplate x:Key="PhoneProgressBarSliderThumb" TargetType="Thumb">
<Rectangle Fill="{TemplateBinding Foreground}" Height="24" IsHitTestVisible="False" Width="24"/>
</ControlTemplate>
<Style x:Key="PhoneProgressBarSliderStyle" TargetType="Slider">
<Setter Property="Maximum" Value="3000"/>
<Setter Property="Minimum" Value="0"/>
<Setter Property="Value" Value="0"/>
<Setter Property="Opacity" Value="0"/>
<Setter Property="IsTabStop" Value="False"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Slider">
<Grid IsHitTestVisible="False">
<Grid x:Name="HorizontalTemplate">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<RepeatButton x:Name="HorizontalTrackLargeChangeDecreaseRepeatButton" Grid.Column="0" Height="0" Template="{x:Null}"/>
<Thumb x:Name="HorizontalThumb" Grid.Column="1" Foreground="{TemplateBinding Foreground}" Height="24" IsTabStop="False" Template="{StaticResource PhoneProgressBarSliderThumb}"/>
<RepeatButton x:Name="HorizontalTrackLargeChangeIncreaseRepeatButton" Grid.Column="2" Height="0" Template="{x:Null}"/>
</Grid>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ProgressBarStyle1" TargetType="ProgressBar">
<Setter Property="Height" Value="30"/>
<!--<Setter Property="Foreground" Value="{StaticResource PhoneAccentBrush}"/>
<Setter Property="Background" Value="{StaticResource PhoneAccentBrush}"/>-->
<Setter Property="Foreground" Value="YellowGreen"/>
<Setter Property="Background" Value="Blue"/>
<Setter Property="Maximum" Value="100"/>
<Setter Property="IsHitTestVisible" Value="False"/>
<Setter Property="Padding" Value="{StaticResource PhoneHorizontalMargin}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ProgressBar">
<Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Determinate"/>
<VisualState x:Name="Indeterminate">
<Storyboard Duration="00:00:04.4" RepeatBehavior="Forever">
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="IndeterminateRoot">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<Visibility>Visible</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="DeterminateRoot">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<Visibility>Collapsed</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Value" Storyboard.TargetName="Slider1">
<EasingDoubleKeyFrame KeyTime="00:00:00.5" Value="1000">
<EasingDoubleKeyFrame.EasingFunction>
<ExponentialEase EasingMode="EaseOut" Exponent="1"/>
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
<LinearDoubleKeyFrame KeyTime="00:00:02.0" Value="2000"/>
<EasingDoubleKeyFrame KeyTime="00:00:02.5" Value="3000">
<EasingDoubleKeyFrame.EasingFunction>
<ExponentialEase EasingMode="EaseIn" Exponent="1"/>
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00.2" Storyboard.TargetProperty="Value" Storyboard.TargetName="Slider2">
<EasingDoubleKeyFrame KeyTime="00:00:00.5" Value="1000">
<EasingDoubleKeyFrame.EasingFunction>
<ExponentialEase EasingMode="EaseOut" Exponent="1"/>
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
<LinearDoubleKeyFrame KeyTime="00:00:02.0" Value="2000"/>
<EasingDoubleKeyFrame KeyTime="00:00:02.5" Value="3000">
<EasingDoubleKeyFrame.EasingFunction>
<ExponentialEase EasingMode="EaseIn" Exponent="1"/>
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00.4" Storyboard.TargetProperty="Value" Storyboard.TargetName="Slider3">
<EasingDoubleKeyFrame KeyTime="00:00:00.5" Value="1000">
<EasingDoubleKeyFrame.EasingFunction>
<ExponentialEase EasingMode="EaseOut" Exponent="1"/>
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
<LinearDoubleKeyFrame KeyTime="00:00:02.0" Value="2000"/>
<EasingDoubleKeyFrame KeyTime="00:00:02.5" Value="3000">
<EasingDoubleKeyFrame.EasingFunction>
<ExponentialEase EasingMode="EaseIn" Exponent="1"/>
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00.6" Storyboard.TargetProperty="Value" Storyboard.TargetName="Slider4">
<EasingDoubleKeyFrame KeyTime="00:00:00.5" Value="1000">
<EasingDoubleKeyFrame.EasingFunction>
<ExponentialEase EasingMode="EaseOut" Exponent="1"/>
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
<LinearDoubleKeyFrame KeyTime="00:00:02.0" Value="2000"/>
<EasingDoubleKeyFrame KeyTime="00:00:02.5" Value="3000">
<EasingDoubleKeyFrame.EasingFunction>
<ExponentialEase EasingMode="EaseIn" Exponent="1"/>
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00.8" Storyboard.TargetProperty="Value" Storyboard.TargetName="Slider5">
<EasingDoubleKeyFrame KeyTime="00:00:00.5" Value="1000">
<EasingDoubleKeyFrame.EasingFunction>
<ExponentialEase EasingMode="EaseOut" Exponent="1"/>
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
<LinearDoubleKeyFrame KeyTime="00:00:02.0" Value="2000"/>
<EasingDoubleKeyFrame KeyTime="00:00:02.5" Value="3000">
<EasingDoubleKeyFrame.EasingFunction>
<ExponentialEase EasingMode="EaseIn" Exponent="1"/>
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Slider1">
<DiscreteDoubleKeyFrame KeyTime="0" Value="1"/>
<DiscreteDoubleKeyFrame KeyTime="00:00:02.5" Value="0"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00.2" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Slider2">
<DiscreteDoubleKeyFrame KeyTime="0" Value="1"/>
<DiscreteDoubleKeyFrame KeyTime="00:00:02.5" Value="0"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00.4" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Slider3">
<DiscreteDoubleKeyFrame KeyTime="0" Value="1"/>
<DiscreteDoubleKeyFrame KeyTime="00:00:02.5" Value="0"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00.6" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Slider4">
<DiscreteDoubleKeyFrame KeyTime="0" Value="1"/>
<DiscreteDoubleKeyFrame KeyTime="00:00:02.5" Value="0"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00.8" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Slider5">
<DiscreteDoubleKeyFrame KeyTime="0" Value="1"/>
<DiscreteDoubleKeyFrame KeyTime="00:00:02.5" Value="0"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid x:Name="DeterminateRoot" Margin="{TemplateBinding Padding}" Visibility="Visible">
<Rectangle x:Name="ProgressBarTrack" Fill="{TemplateBinding Background}" Height="24" Opacity="0.1"/>
<Rectangle x:Name="ProgressBarIndicator" Fill="{TemplateBinding Foreground}" HorizontalAlignment="Left" Height="24"/>
</Grid>
<Border x:Name="IndeterminateRoot" Margin="{TemplateBinding Padding}" Visibility="Collapsed">
<Grid>
<Slider x:Name="Slider1" Foreground="{TemplateBinding Foreground}" Style="{StaticResource PhoneProgressBarSliderStyle}"/>
<Slider x:Name="Slider2" Foreground="{TemplateBinding Foreground}" Style="{StaticResource PhoneProgressBarSliderStyle}"/>
<Slider x:Name="Slider3" Foreground="{TemplateBinding Foreground}" Style="{StaticResource PhoneProgressBarSliderStyle}"/>
<Slider x:Name="Slider4" Foreground="{TemplateBinding Foreground}" Style="{StaticResource PhoneProgressBarSliderStyle}"/>
<Slider x:Name="Slider5" Foreground="{TemplateBinding Foreground}" Style="{StaticResource PhoneProgressBarSliderStyle}"/>
</Grid>
</Border>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</phone:PhoneApplicationPage.Resources>
My .cs:
progBar.Style = (Style)this.Resources["ProgressBarStyle1"];
STYLE WAS FOUND ON INTERNET <<<<<
i'm trying to prevent a selected item(TextBlock in Grid) in a listbox from changing its color.
I've found some questions/answers with similar problems in wpf and silverlight, but their solution with "HighlightTextBrush" seems not to work in WP7.
So can you please tell me how to do this?
Thanks im advance!
Changing "HighlightTextBrush" is calling for trouble, don't do it.
The right way is to have a style for the ListBoxItem.
You need a style that, effectively, does not have a selected state:
<Style x:Key="ListBoxItemStyle1" TargetType="ListBoxItem">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="VerticalContentAlignment" Value="Top"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
<Border x:Name="LayoutRoot" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="MouseOver"/>
<VisualState x:Name="Disabled">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="LayoutRoot">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TransparentBrush}"/>
</ObjectAnimationUsingKeyFrames>
<DoubleAnimation Duration="0" To=".5" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="ContentContainer"/>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="SelectionStates">
<VisualState x:Name="Unselected"/>
<VisualState x:Name="Selected">
<!--This is the storyboard to remove-->
<!--<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneAccentBrush}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>-->
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<ContentControl x:Name="ContentContainer" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
This is the original style out of Blend (OS 7.0, I think), the only change is commenting the storyboard in the Selected state.